On Tuesday 4 February 2003 12:03am, Kate L Pugh wrote: > - Any suggestions for getting the following test to pass? (At the moment > it fails because the trailing ']' is getting assumed to be the end of > the URL; I'm using ($close_re?) to match the closing delimiter because > I don't want to force it to be there. What I really want is something > that can force it to be there if and only if the opening delimiter was > found, but I'm not allowed to do variable-width look-behind assertions.)
Does it work if, in find(), you replace $$r_text =~ s{$prefix_re # maybe don't match things preceded by a " ($open_re?) # opening wrapping marker ($uriRe) # the URI itself ([ \t]*) # optional whitespace between URI and title ((?<=[ \t])[^\n$close_re]+)? # title if there was whitespace ($close_re?) # closing wrapping marker }{ with $$r_text =~ s{$prefix_re # maybe don't match things preceded by a " (?: ($open_re) # opening wrapping marker ($uriRe) # the URI itself ([ \t]*) # optional whitespace between URI and title ((?<=[ \t])[^\n$close_re]+)? # title if there was whitespace ($close_re) # closing wrapping marker | () # no opening wrapping marker ($uriRe) # the URI itself ([ \t]*) # optional whitespace between URI and title ((?<=[ \t])[^\n$close_re]+)? # title if there was whitespace () # no closing wrapping marker ) }{ ? -- \|/GET| Dave Hinton -/SOME| Battersea, London, England /SLEEP| http://thereaction.co.uk/dah