Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: regex for strings with escaped quotes

by haukex (Bishop)
on Feb 12, 2019 at 15:19 UTC ( #1229803=note: print w/replies, xml ) Need Help??


in reply to Re^2: regex for strings with escaped quotes
in thread regex for strings with escaped quotes

I there a way to print the regex that is used?

That's what the second line of output above is. Simplification of that regex is left as an exercise to the reader :-) (Update: Nevermind.)

BTW, you can also use the -keep feature to get only the part between the quotes:

use Regexp::Common qw/delimited/; q{ x "foo \"bar\"" y } =~ /$RE{delimited}{-delim=>'"'}{-keep}/; print $3, "\n"; # prints: foo \"bar\"

Replies are listed 'Best First'.
Re^4: regex for strings with escaped quotes
by morgon (Priest) on Feb 12, 2019 at 15:24 UTC
    Many thanks.

    This is exactly what I need - let's see if I can feed that to the go-engine...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2021-03-08 18:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (126 votes). Check out past polls.

    Notices?