[comp.lang.c] checking strings for regex metachars

goer@sophist.uucp (Richard Goerwitz) (03/18/90)

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@uchicago.bitnet
   goer@sophist.uchicago.edu         rutgers!oddjob!gide!sophist!goer