Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Matching quote characters?

by TedPride (Priest)
on Aug 06, 2006 at 22:02 UTC ( #565868=note: print w/replies, xml ) Need Help??


in reply to Matching quote characters?

The object is to get the shortest possible string that starts with " and ends with either " or the end of the sample. So:
while (<DATA>) { chomp; print "$1\n" while m/(".*?(?:"|$))/g; } __DATA__ abc "def "ghi" jkl" mno"pqr"stu v"wx"y"z"

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://565868]
help
Chatterbox?
[Discipulus]: ah Corion you are where thatched roof are? good for you
Discipulus greeting from Dumbar?
Discipulus Umbar..

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (12)
As of 2017-11-23 09:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (333 votes). Check out past polls.

    Notices?