how about assuming that N (>= 1) closing brackets at the end are only NOT part of the url if there are N more opening than closing brackets in the text BEFORE the url? to me it seems that this would cover most real-world cases..

text url
(text url)
text url)
(text) url)
text url()
(text url())
((text url()))
((text)) url()

red = not part of url, green = part of url

note that this is right-to-left and therefore does not require counting of the brackets within the url at all

Edit I guess that's what the guy in the other thread suggested as well

Last edited by Sat; 05/06/08 05:56 PM.

Saturn, QuakeNet staff