Re: \b in regexp..

2004-04-14 Thread david
Jayakumar Rajagopal wrote: > friends, > > script : > > $_='as great as perl'; > print $& ."\n" if (/\beat/); > print $& ."\n" if (/\bgre/); > > output : > gre > *** > Why 'boundary' assertion does not match in end of word , but only the > start of wor

Re: b in regexp..

2004-04-14 Thread u235sentinel
If I'm reading this correctly, you are trying to match a word at the end of a string. If that's the case then move the word boundary to the end of your match. print $& ."\n" if (/eat\b/); print $& ."\n" if (/gre\b/); Reading from the "Learning Perl 3rd" Edition on page 108: "The \b anchor matc

\b in regexp..

2004-04-14 Thread Jayakumar Rajagopal
friends, script : $_='as great as perl'; print $& ."\n" if (/\beat/); print $& ."\n" if (/\bgre/); output : gre *** Why 'boundary' assertion does not match in end of word , but only the start of word? thanks, Jay -- To unsubscribe, e-mail: [EMAIL PRO