Path: utzoo!attcan!uunet!cs.utexas.edu!rutgers!mcnc!uvaarpa!mmdf From: worley@compass.com (Dale Worley) Newsgroups: comp.lang.perl Subject: Regexps (was Re: Changing the first character of a string.) Message-ID: <1990Jul5.135434.11673@uvaarpa.Virginia.EDU> Date: 5 Jul 90 13:54:34 GMT Sender: mmdf@uvaarpa.Virginia.EDU (Uvaarpa Mail System) Reply-To: worley@compass.com Organization: The Internet Lines: 27 From: merlyn@iwarp.intel.com (Randal Schwartz) Regexps are well-defined and extremely predicatable about their "leftmost wildcard matches the most possible iterations" behavior. OK, where is it written down? Also, you forgot to mention that | attempts to match the left alternative before the right. (I mention that to show that it's not so easy to completely define dynamic behavior.) It's no more silly than presuming that "a" really matches "a", is it? Well, every exposition of "regular expressions" I've ever seen states that "a" matches only "a", but I've never seen *in print* anyone stating that regexps match the most possible first. Also, I have a general preference for declarative definitions of things above dynamic definitions. Dale Worley Compass, Inc. worley@compass.com -- It was peculiarly satisfying to watch the reactions at the truck stops along the way to this bunch of men with hippie long hair, biker leather jackets, and a nose ring who nonetheless were warm, intelligent, friendly and polite, and paid with credit cards - we blew all their possible-stereotype fuses.