Path: utzoo!attcan!uunet!cs.utexas.edu!rutgers!mcnc!uvaarpa!mmdf From: worley@compass.com (Dale Worley) Newsgroups: comp.lang.perl Subject: Changing the first character of a string. Message-ID: <1990Jul5.135434.11674@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: 24 From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) You'll have to ask the designers of C that question. Perl isn't treating it at all specially here--it's just relying on the convention that normal text never contains it. /[^\0]/ is just an idiom for matching any textual character including newline, which /./ specifically won't match. Sounds like a good way to get screwed if the string actually contains a NUL. Why not "(.|\n)"? But what about multi-character delimiters such as C comments? Well, my preference is something like .* \- .*/\*.* (exploiting the fact that the complement of a regular language is regular), but nobody implements that. Dale Worley Compass, Inc. worley@compass.com -- Software without hardware is an idea. Hardware without software is a space heater.