Home: Perl Programming Help: Regular Expressions:
Clarification with $+



perllearner
Novice

Aug 11, 2009, 11:17 PM


Views: 4651
Clarification with $+

Hi,

Can any one please clarify what is meaning of the following

1.$&
2.$`
3.$'
4. In pattern matching I have seen they use this
=~ /\b[A-Z]\S+/g, what is the meaning of \b.


spider
User


Aug 12, 2009, 1:01 AM


Views: 4648
Re: [perllearner] Clarification with $+

Subject: $+ returns whatever the last bracket match matched.
1. $& returns the entire matched string.
2. $` returns everything before the matched string.
3. $' returns everything after the matched string.
4. The \b is word boundary.
Take a look at http://perldoc.perl.org/perlre.html


perllearner
Novice

Aug 12, 2009, 4:08 AM


Views: 4644
Re: [spider] Clarification with $+

Thanks a lot Spider...