Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site tektronix.UUCP Path: utzoo!linus!decvax!tektronix!richl From: richl@tektronix.UUCP (Rick Lindsley) Newsgroups: net.bugs.4bsd Subject: Re: Reg Expr bugs in vi? - (nf) Message-ID: <1411@tektronix.UUCP> Date: Wed, 28-Sep-83 03:38:58 EDT Article-I.D.: tektroni.1411 Posted: Wed Sep 28 03:38:58 1983 Date-Received: Wed, 28-Sep-83 20:59:52 EDT References: <2990@uiucdcs.UUCP> Organization: Tektronix, Beaverton OR Lines: 41 The examples you gave worked perfectly correctly. On the input skd jflksd jfsdlk llkwejrlkw hllejrljlkajioerumm jlrkwejrkw2345kld';l./,l sdfl you said that the following search patterns all seem to behave the same way. /^[a-z] /.*[a-z] /[a-z].* And well they should. Perhaps you are confusing shell syntax with regular expression syntax. The combination ".*" will match anything of any length. Thus the 1st example will find the first line that starts with the letters a-z; the second and third will find the first lowercase letter after the cursor. Your second example, /,.*[0-9] instead of /,*[0-9] works like this: the first example will find the first line with a comma and a number in it. Both ,0 and ,ldfjljlsajfldfjlfasjfj0 will be found by that pattern. The second will find only a line with a number in it, because '*' can match null too. It could conceivably find a line of the type ,,,,,,,,,,,,,,,,,,,,,,,1 also, but it would also work on 1 Playing with regular expressions can be tricky. Perhaps before you yell "bug" you should explain exactly what you were trying to do rather than what you did. Rick Lindsley richl@tektronix ...!tektronix!richl