Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

How backtracking works in regular expressions

by ikegami (Patriarch)
on Sep 10, 2004 at 15:33 UTC ( #390117=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    Match against 'abbbbbbc'
                   01234567
    ...
    4) ok!   Found a 'b' at pos 6.            pos = 7.
    5) ok!   Found a 'c' at pos 7.            pos = 8.
    Match!
    
  2. or download this
    Match against 'root: email'
                   01234567890
    ...
    4) ok!   Found something other than 'email' at pos 5.  pos = 5. (zwla)
             (found ' email')
    Match!
    
  3. or download this
    Match against 'root: email'
                   01234567890
    ...
    5) fail! Did not find a '\S' at pos 5.                 Backtrack!
    Nothing more to try.
    No match!
    
  4. or download this
    Match against 'root: hisemail'
                   01234567890123
    ...
             (found 'hisemail')
    5) ok!   Found a '\S' at pos 6.                        pos = 6.
    Match!
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://390117]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2022-05-22 22:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (81 votes). Check out past polls.

    Notices?