Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^5: regexp - replace spaces in quoted string

by japhy (Canon)
on Sep 06, 2005 at 13:49 UTC ( [id://489498]=note: print w/replies, xml ) Need Help??


in reply to Re^4: regexp - replace spaces in quoted string
in thread regexp - replace spaces in quoted string

Um, you mis-used my module. Only the LEFT-HAND side of a s/// is a regex; therefore, only the left-hand side should be sent through YAPE::R::E.

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart
  • Comment on Re^5: regexp - replace spaces in quoted string

Replies are listed 'Best First'.
Re^6: regexp - replace spaces in quoted string
by planetscape (Chancellor) on Sep 06, 2005 at 14:45 UTC

    Oopsie. I'm on drugs - that's my excuse.

    (No, really - oral surgery last Wednesday. That's my story, and I'm sticking to it!)

    Corrected stuff:

    The regular expression: (?-imsx:(".*?")) matches as follows: NODE EXPLANATION ---------------------------------------------------------------------- (?-imsx: group, but do not capture (case-sensitive) (with ^ and $ matching normally) (with . not matching \n) (matching whitespace and # normally): ---------------------------------------------------------------------- ( group and capture to \1: ---------------------------------------------------------------------- " '"' ---------------------------------------------------------------------- .*? any character except \n (0 or more times (matching the least amount possible)) ---------------------------------------------------------------------- " '"' ---------------------------------------------------------------------- ) end of \1 ---------------------------------------------------------------------- ) end of grouping ----------------------------------------------------------------------

    The point about YAPE::Regex::Explain being useful to someone learning regexes is still perfectly valid, despite my mistake. :-)

    planetscape
Re^6: regexp - replace spaces in quoted string
by halley (Prior) on Sep 06, 2005 at 14:19 UTC
    Sounds like a feature request to me. ;)

    Another suggestion: if the whole regex is surrounded by a fully qualified (?xi-sm: ... ) block, then it's likely created by the qr// stringification, and not as presented. I would consider stripping that off and then explain the modes at the end along with any /g /e explanations.

    --
    [ e d @ h a l l e y . c c ]

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-26 00:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found