Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Match something that does not match

by haukex (Archbishop)
on Feb 15, 2020 at 21:41 UTC ( [id://11113011]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Match something that does not match
in thread Match something that does not match

Though it works, I still don't get it :-(

The . matches anything (except newline), and (?!$pat) means "the next thing can't be $pat", so taken all together it really just means "match any number of characters, where none of these characters may be the first character of $pat".

Replies are listed 'Best First'.
Re^4: Match something that does not match
by jo37 (Deacon) on Feb 15, 2020 at 22:18 UTC

    I was challenged by the mental step of putting something after a look-ahead assertion. Failing to understand this lead to the missing last character in the second branch of my original regex.
    Anyway, the fog lifts. Thanks a lot!

    -jo

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-04-19 15:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found