Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: sorry, didn't ask the right question about this regex yesterday (?!)

by tye (Sage)
on Apr 21, 2016 at 14:47 UTC ( [id://1161100]=note: print w/replies, xml ) Need Help??


in reply to sorry, didn't ask the right question about this regex yesterday

/^ABC(?!Z$)/

- tye        

  • Comment on Re: sorry, didn't ask the right question about this regex yesterday (?!)
  • Download Code

Replies are listed 'Best First'.
Re^2: sorry, didn't ask the right question about this regex yesterday (?!)
by misterperl (Pilgrim) on Apr 21, 2016 at 14:57 UTC
    superdoc as Johnny used to say, "that is WILD and WACKY stuff!". I'm not sure how that works exactly but I'll try it in YAPE...

    As Ed used to tell Johnny- "YOU ARE CORRECT SIR!"...

    Thanks so much!

      Hello misterperl,

      I'm not sure how that works exactly...

      From “Look-Around Assertions” in perlre#Extended-Patterns:

      • (?!pattern)
        A zero-width negative look-ahead assertion. For example /foo(?!bar)/ matches any occurrence of "foo" that isn't followed by "bar".

      If you have access to the Camel Book, see also Chapter 5: Pattern Matching, section “Fancy Patterns,” subsection “Lookaround Assertions.”

      Hope that helps,

      Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-24 06:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found