Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

How backtracking works in regular expressions

by ikegami (Pope)
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 lurking in the Monastery: (4)
As of 2021-12-09 13:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (36 votes). Check out past polls.

    Notices?