CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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

 



perllearner
Novice

Aug 11, 2009, 11:17 PM

Post #1 of 3 (2208 views)
Clarification with $+ Can't Post

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

Post #2 of 3 (2205 views)
Re: [perllearner] Clarification with $+ [In reply to] Can't Post

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

Post #3 of 3 (2201 views)
Re: [spider] Clarification with $+ [In reply to] Can't Post

Thanks a lot Spider...

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives