Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: RegExp Delimiter

by Dog and Pony (Priest)
on Sep 03, 2002 at 07:08 UTC ( [id://194695]=note: print w/replies, xml ) Need Help??


in reply to RegExp Delimiter

It isn't limited to the regexps, it is all the "Quote and Quote like Operators" - follow the link for at least some details on what is allowed and what is not.
You have moved into a dark place.
It is pitch black. You are likely to be eaten by a grue.

Replies are listed 'Best First'.
Re: Re: RegExp Delimiter
by perchance (Monk) on Sep 03, 2002 at 08:03 UTC
    Hallelujah!
    For some reason I assumed ?? would work same as //, little realizing that it is its own operator.
    I just couldn't figure out why it only responded to the first instance, until I ran into it through your link...

    10x,
    ---perchance
      // is an m-less form of m//. This means that m?? is the functional equivalent. Or m!!, m>> or even m**.

      Considering // will soon be an operator, things are sure going to get interesting.

      Update:
      What Dog and Pony is talking about is this bit:
      If "/" is the delimiter then the initial m is optional. With the m you can use any pair of non-alphanumeric, non-whitespace characters as delimiters. This is particularly useful for matching path names that contain "/", to avoid LTS (leaning toothpick syndrome). If "?" is the delimiter, then the match-only-once rule of ?PATTERN? applies. If "'" is the delimiter, no interpolation is performed on the PATTERN.
      I find that I use hash-marks as a replacement more often than not(m##), or, on those occasions where that's no good, excamation marks (m!!). Now I remember why I don't use '?'.
        // is indeed the m-less form of m//, but ?? is not, it is a special case of //. Which may lead to lots of confusion if one uses questionmarks as delimiters for their regexps.

        I assume you know this, just clarifying further for those that may not. :)


        You have moved into a dark place.
        It is pitch black. You are likely to be eaten by a grue.
        On the other hand we will get the grammar to parse it correctly built right into the language, so discounting the fact that it may confuse humans, things will actually be less ambiguous.

        Makeshifts last the longest.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-25 06:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found