Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Death to Dot Star!

by Anonymous Monk
on Apr 03, 2001 at 06:32 UTC ( #69182=note: print w/ replies, xml ) Need Help??


in reply to Death to Dot Star!

Why not just $myvar =~ /"([^"]*)\?"/


Comment on Re: Death to Dot Star!
Download Code
(Ovid) Re(2): Death to Dot Star!
by Ovid (Cardinal) on Apr 03, 2001 at 10:12 UTC
    /"([^"]*)\?"/ 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.

      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://69182]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (19)
As of 2014-07-23 14:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (144 votes), past polls