Path: utzoo!attcan!uunet!zephyr.ens.tek.com!uw-beaver!mit-eddie!snorkelwacker!think!samsung!cs.utexas.edu!mailrus!ames!ncar!tank!sophist!goer From: goer@sophist.uucp (Richard Goerwitz) Newsgroups: comp.lang.c Subject: checking strings for regex metachars Summary: anyone have a procedure to do this ^ around? Message-ID: <8113@tank.uchicago.edu> Date: 17 Mar 90 16:58:52 GMT Sender: news@tank.uchicago.edu Reply-To: goer@sophist.UUCP (Richard Goerwitz) Organization: University of Chicago Lines: 14 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