Re: java.util.regex.Matcher

Discussion in 'Java' started by Roedy Green, Jul 30, 2003.

  1. Roedy Green

    Roedy Green Guest

    On 30 Jul 2003 13:44:36 -0700, wrote or quoted
    :

    >Does any one know how, the find method actually works, and the
    >associated running time?


    The Pattern is compiled into a state machine. At each state, the
    engine looks at what character came in, and choses the next state.

    Pattern does not compile it all the way to byte code. The state
    machine is interpreted.


    Speaking loosely, you could in principle imagine each state being a
    method with giant SWITCH statement that categories the input, and
    decides if we have a match so far, and the state to carry on next at,
    or a failure, in which case the controlling engine will backtrack.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Jul 30, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. IchBin

    Question on Pattern Matcher?

    IchBin, Jan 1, 2005, in forum: Java
    Replies:
    5
    Views:
    390
    IchBin
    Jan 2, 2005
  2. hiwa
    Replies:
    0
    Views:
    299
  3. Replies:
    1
    Views:
    2,998
  4. Moiristo

    java pattern matcher

    Moiristo, Jul 12, 2006, in forum: Java
    Replies:
    7
    Views:
    2,828
    lordy
    Jul 13, 2006
  5. joes
    Replies:
    2
    Views:
    1,002
    Daniel Pitts
    May 25, 2007
Loading...

Share This Page