![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SED regular expressions | noppeli | Shell Programming and Scripting | 3 | 09-10-2009 08:53 AM |
| regular expressions | ramky79 | UNIX for Advanced & Expert Users | 1 | 05-26-2009 03:35 PM |
| Need help with Regular Expressions | jidsh | Shell Programming and Scripting | 5 | 04-20-2009 05:00 PM |
| Awk regular expressions | chella | Shell Programming and Scripting | 1 | 03-30-2009 07:32 AM |
| regular expressions | whatever | Shell Programming and Scripting | 4 | 05-20-2007 05:30 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Code:
#!/usr/bin/perl
$word = "one last challenge";
if ( $word =~ /^(\w+).*\s(\w+)$/ )
{
print "$1";
print "\n";
print "$2";
}
The output shows that "$1" is with result one and "$2" is with result challenge. I am confused about how this pattern match expression works step by step. I request u guys` explanation. Thank u very much. Last edited by pludi; 11-02-2009 at 09:57 AM.. Reason: code tags, please... |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|