Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: positive look behind regexp mystery (\K assertion)

by lodin (Hermit)
on Aug 14, 2008 at 12:54 UTC ( #704341=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    s/\.\K[^.]*$/txt/;
    
  2. or download this
    Compiling REx "(?<=[.])[^.]*$"
    Final program:
    ...
       7 <xyz.foo> <>            | 19:  EOL(20)
       7 <xyz.foo> <>            | 20:  END(0)
    Match successful!
    
  3. or download this
    Compiling REx "\.\K[^.]*$"
    Final program:
    ...
       7 <xyz.foo> <>            | 16:    EOL(17)
       7 <xyz.foo> <>            | 17:    END(0)
    Match successful!
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2022-05-20 18:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (75 votes). Check out past polls.

    Notices?