checking strings for regex metachars

Richard Goerwitz goer at sophist.uucp
Sun Mar 18 02:58:52 AEST 1990


Call it laziness, or call it what you want.  Does anyone have
a function lying around that determines whether a given string
contains metacharacters (i.e. which takes into account escapes
and all)?  Maybe someone would also be willing to discuss whether
it is worth making such a determination.  Is it just better to
compile everything as a regular expression, and just not worry
about whether there are metacharacters?  I'm sure efficiency
varies from implementation to implementation.  I just have not
done enough programming in C to know whether compiling a plain
string for use with regex inevitably means a big performance
drop over doing the comparison manually.

   -Richard L. Goerwitz              goer%sophist at uchicago.bitnet
   goer at sophist.uchicago.edu         rutgers!oddjob!gide!sophist!goer



More information about the Comp.lang.c mailing list