Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

How backtracking works in regular expressions

by ikegami (Patriarch)
on Sep 10, 2004 at 15:33 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (1)
As of 2024-04-24 16:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found