>
> $pattern ="/(^.*?sheet\/)pub(.*)(\&[a-z\=]*$)/";
>

I arrived at the above pattern to parse a published gdoc spreadsheet url: 
example -

https://spreadsheets.google.com/spreadsheet/pub?hl=en_GB&hl=en_GB&key=0BcCVZg3fefASrFG1P7HxN1Mnb241cFNKS0dVUNjUO5c&output=html
    


The part of the pattern after 'pub' is the bit which puzzles me. The first 
set of parentheses after 'pub' can contain anything. So why doesn't it grab 
everything up to the end of the line ?

It seems to be halted in a non-greedy way by the last parentheses which 
defines a string connected to the EOL and stretching back to the first 
encountered ampersand. 

Why this works, I do not know. I'm glad it does. Does anyone know why i.e 
why the (.*) after 'pub' doesn't overrule the (\&[a-z\=]*$) ?

tom

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to