Velocity Reviews - Computer Hardware Reviews

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

Thread Tools

Re: java.util.regex.Matcher

Roedy Green
Posts: n/a
On 30 Jul 2003 13:44:36 -0700, 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 for The Java Glossary.
Reply With Quote

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