2005-07-06, 07:54
phunck, thanks for such a wonderful script! ooba is my new best friend and i intend to contribute by submitting some patterns.
there is somethig that puzzles me as i am trying to understand the regexp notations in teh included menu.xml file. in the following code:
inside the <pattern> element, the part ?p<url>[^"'<>]+ is totally new to me. i know the ?p<url> is essentially giving whatever matches next a named identifier called url, but what follows, that is, [^"'<>]+ is very new to me. it is basically an attempt to match the url address of a resource enclosed in "s inside an href tag, but i don't see how it works. it's used repeatedly in a lot of patterns in the menu.xml file for ooba and it works. i just don't know how or why. what does this syntax mean?
any insights will be very much appreciated
cheers
shah
there is somethig that puzzles me as i am trying to understand the regexp notations in teh included menu.xml file. in the following code:
Quote:<action type="submenu">
<url><![cdata[^http://news.bbc.co.uk/.*/nb_rm_default]]></url>
<linkpattern>
<pattern><![cdata[<a href="(?p<url>[^"'<>]+)"\s+class="story">(?p<title>[^<>]+)</]]></pattern>
</linkpattern>
</action>
inside the <pattern> element, the part ?p<url>[^"'<>]+ is totally new to me. i know the ?p<url> is essentially giving whatever matches next a named identifier called url, but what follows, that is, [^"'<>]+ is very new to me. it is basically an attempt to match the url address of a resource enclosed in "s inside an href tag, but i don't see how it works. it's used repeatedly in a lot of patterns in the menu.xml file for ooba and it works. i just don't know how or why. what does this syntax mean?
any insights will be very much appreciated
cheers
shah