Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

(Ovid) Re(2): Death to Dot Star!

by Ovid (Cardinal)
on Apr 03, 2001 at 10:12 UTC ( #69214=note: print w/ replies, xml ) Need Help??


in reply to Re: Death to Dot Star!
in thread Death to Dot Star!

/"([^"]*)\?"/ almost works, but often, quoted strings allow escapes:

my $myvar = '"Did John say \"go home\" to Suzie?"'; $myvar =~ /"([^"]*)\?"/;
The above code will put " to Suzie" (without the quotes) in $1.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.


Comment on (Ovid) Re(2): Death to Dot Star!
Select or Download Code
Replies are listed 'Best First'.
Re: (Ovid) Re(2): Death to Dot Star!
by Anonymous Monk on Apr 13, 2001 at 01:34 UTC
    So does yours. If you want to allow \" inside strings, you need to use something like /"((?:\\"|[^"])*)\?"/

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2015-07-28 01:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (251 votes), past polls