Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Match/Replace/Interpolate

by toadi (Chaplain)
on Jul 21, 2006 at 08:58 UTC ( [id://562809]=note: print w/replies, xml ) Need Help??


in reply to Re: Match/Replace/Interpolate
in thread Match/Replace/Interpolate

Hi Corion, thanks for the reply. What do the ! mean instead of the normal / in the regex?


--
My opinions may have changed,
but not the fact that I am right

Replies are listed 'Best First'.
Re^3: Match/Replace/Interpolate
by Corion (Patriarch) on Jul 21, 2006 at 09:01 UTC

    The ! are used as alternative delimiters, because you use / within the regular expression. This makes it easy to avoid the escaping of slashes. Instead of \/, I now can write / as it will not be recognized as the regex delimiter anymore.

    perlop has the section on Regexp Quote-like Operators which explains how this works.

Re^3: Match/Replace/Interpolate
by gellyfish (Monsignor) on Jul 21, 2006 at 09:01 UTC

    They don't mean anything special, you can replace the '/' with any other character (or matching pairs of brackets) to improve readability and reduce the requirement for escaping of literal '/' characters in your expression.

    /J\

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-03-28 15:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found