Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Re: java.util.regex.Matcher

Reply
Thread Tools

Re: java.util.regex.Matcher

 
 
Roedy Green
Guest
Posts: n/a
 
      07-30-2003
On 30 Jul 2003 13:44:36 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments