>-----Original Message----- >From: John W. Krahn [mailto:jwkr...@shaw.ca] >Sent: Tuesday, July 20, 2010 15:06 >To: Perl Beginners >Subject: Re: Word boundaries > >Rob Dixon wrote: >> On 20/07/2010 16:22, Chandan Kumar wrote: >>> >>> Small confusion about word boundaries. word boundaries matches >>> anything between non-word character and word character ,right. >> >> Not quite. > >Quite. > >> /\b/ matches any (zero-length) point in a string between a >> word and a non-word character, > >Correct. > >> or between a word character and the >> beginning or end of the string, > >Incorrect. It matches *only* between \w and \W characters. > > But for the test you were doing, you could have added this: (\b{0,1}\W\b) which would have gotten you the ? as the output, but unsure that that is what you really wanted...
If you have any questions and/or problems, please let me know. Thanks. Wags ;) David R. Wagner Senior Programmer Analyst FedEx Services 1.719.484.2097 Tel 1.719.484.2419 Fax 1.408.623.5963 Cell http://Fedex.com/us > > >John >-- >Any intelligent fool can make things bigger and >more complex... It takes a touch of genius - >and a lot of courage to move in the opposite >direction. -- Albert Einstein > >-- >To unsubscribe, e-mail: beginners-unsubscr...@perl.org >For additional commands, e-mail: beginners-h...@perl.org >http://learn.perl.org/ > -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/