![]() |
|
|
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 |
| extraction of last but one char | hidnana | Shell Programming and Scripting | 5 | 02-14-2008 08:22 AM |
| AWK extraction | harris2107 | Shell Programming and Scripting | 2 | 01-15-2008 11:44 AM |
| AWK extraction | harris2107 | Shell Programming and Scripting | 3 | 08-17-2007 06:02 AM |
| Optimize/speed-up perl extraction | pinpe | Shell Programming and Scripting | 3 | 08-04-2007 10:13 AM |
| Help with tar extraction! | manthasirisha | Shell Programming and Scripting | 4 | 03-17-2006 07:17 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
metapattern extraction in PERL
Hi,
I want to extract some part of a pattern that matches my requirement in a string with PERL. A case in point is a string like: $eqtst="abh nmae res = 10 s abh nmae req = 10 s"; from which I want the words preceding the "=" symbol. Previously I was assured that there would be only 2 such "=" symbols in a string and so I used sthg like: $eqtst =~ /\s+(\w+)\s*=.*\s+(\w+)\s*=/ the "()" extracted the words "res", "req" into variables $1, $2 respectively. And life was good .Now however the number of "=" symbols arent limited (might exceed 2 in a string). How do I go about extracting the words which precede "=" now? Thanks, Abhishek |
| Bookmarks |
| Tags |
| regex, regular expressions |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|