Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://565868]
[ww]: OTOH, -- for ads suggesting that being good at games is somehow eq "greatness"
[ambrus]: 1nickg: obviously the gamers don't know. but anyway, I need the whole room backlit, because watching a monitor in a dark room (like many people do) is tiring for my eyes, even more so than doing it in a lit room.
[1nickt]: ambrus I agree. I suspect one's eyes are always trying to adjust across the boundary between very bright and very dark ... like a camera's autofocus struggling to choose the target.

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (15)
As of 2017-03-27 13:58 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (320 votes). Check out past polls.