On Thu, Jun 19, 2003 at 11:07:10AM -0500, Jeremy Nelson wrote:
> >In the end the problem I had was caused by the RedHat regex engine
> >barfing on [[:<:]], even though it was documented in the manpage
> >(FreeBSDs was fine).

> Interesting -- can you give me the exact original RE?  We can others 
> who are using redhat (or other linux distros) to see if we can track
> this problem down.

I'm driving the regex with this:

alias re_match {
  @ :expr = [$0]
  @ :str  = [$1-]

  ^assign re_match_re $regcomp($expr)
  @ :rc = [$regexec($re_match_re $str)]
  eval $regfree($re_match_re)
  ^assign -re_match_re

  return $rc
}

Then I call:
re_match(\[\[:<:\]\]$xx\[\[:>:\]\] $tempStr)
where $xx obviously expands to something helpful. This will cause
a panic on RH but works fine on BSD. Apparently it also dies on
a recent Debian.

I have worked around it with the following abomination:
re_match(\(^|\[^\[:alnum:\]\]\)$xx\(\[^\[:alnum:\]\]|\$\) $tempStr)
Which works great on either.

I'd be very interested in an example of using $regerror() to trap
where $regcomp() fails. The following never seems to get triggered:

if ([$regerror($re)] != []) {
  # Do something
}

Steve

_______________________________________________
List mailing list
[EMAIL PROTECTED]
http://epicsol.org/mailman/listinfo/list

Reply via email to