Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re^2: Puzzled by regex

by syphilis (Chancellor)
on Apr 10, 2013 at 06:53 UTC ( #1027903=note: print w/replies, xml ) Need Help??

in reply to Re: Puzzled by regex
in thread Puzzled by regex

The difference lies only in what is matched, and this is relevant only if this part is captured

Well ... the regex does capture that part but afaics, when both regexes match they both match the same thing.
Do you have an example that demonstrates this difference ?

Just to be clear - I can see that /\S+?/ and /\S+/ could conceivably match differently, but I don't see how /__\S+?__\n/ and /__\S+__\n/ can match differently.
(And it's important to me that I do understand how they match differently if, indeed, they can.)

In case I'm guilty of not presenting the full picture, the regex (it's a split) as it appears in is actually:
@{$DATA{$pkg}} = split /(?m)(__\S+?__\n)/, $data;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1027903]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2017-06-26 14:07 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (580 votes). Check out past polls.