in reply to Need help on regexp
Hi siva.snimmaka,
If your intention is to pick out "abcd_efgh-1.2.3" from "abcd_efgh-1.2.3-hjik-3.4.5.tar.gz", you can used
or any of the previous solutions.$_ = 'abcd_efgh-1.2.3-hjik-3.4.5.tar.gz'; print $1 if /(.+?)-[a-z].+?/i; ## prints abcd_efgh-1.2.3
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Need help on regexp
by kcott (Archbishop) on Aug 04, 2013 at 06:19 UTC | |
by 2teez (Vicar) on Aug 04, 2013 at 06:40 UTC |