Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!bionet!csd4.milw.wisc.edu!bbn!mit-eddie!ll-xn!adelie!mirror!frog!john From: john@frog.UUCP (John Woods) Newsgroups: comp.unix.questions Subject: Re: Regular expression question. Keywords: regexp public-domain BSD SysV alternation :-):-) Message-ID: <1052@frog.UUCP> Date: 2 Mar 89 01:43:00 GMT References: <364@sunny.UUCP> Distribution: na Organization: Misanthropes-R-Us Lines: 28 In article <364@sunny.UUCP>, poage@sunny.UUCP (Tom Poage) writes: > Is there a reason why I don't find regular expressions > with both alternation and explicit number of occurrence > declaration? Here's what I mean ... > In some public-domain regexp routines I can use > (string1|string2) > In other routines I can use > (something){3,4} > However, I have never seen routines with the ability to use > these two constructs together, such as > (x|y|(z){4,5}) > If no one else admits to one, I once modified Henry Spencer's regexp package (which has the first feature) to include the second feature (like System V). I should probably clean it up and test it more before handing it out (Henry's code was of excellent quality, and I wouldn't want to embarass myself :-), but it is available (though perhaps I should send it to him and let him worry about it (as if he isn't busy enough already, what with being months behind summarizing Aviation Leak :-)). -- John Woods, Charles River Data Systems, Framingham MA, (508) 626-1101 ...!decvax!frog!john, john@frog.UUCP, ...!mit-eddie!jfw, jfw@eddie.mit.edu "He should be put in stocks in Lafeyette Square across from the White House and pelted with dead cats." - George F. Will