in reply to Re^2: Regex Help
in thread Regex Help
then change this print $1,$/ if/(\D+?)\d+?/;
to
this print $1,$/ if/(.+?)\s+?\d+?/;
UPDATE:
In case, you have all these data in the same file you can try this:
use strict; use warnings; while(<DATA>){ chomp; print $1,$/ if/(.+?)(\s+)?\d+?$/; } __DATA__ piratesofcareebian100 pirates of careebian100 pirates of careebian 100 pirates1 of careebian 100 pirates2 of careebian 100 pirates3 of careebian 100
Output
Please, check the reference I mentioned in my first post on this thread.piratesofcareebian pirates of careebian pirates of careebian pirates1 of careebian pirates2 of careebian pirates3 of careebian
Hope that helps
If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Regex Help
by Anonymous Monk on Mar 28, 2013 at 07:56 UTC | |
by hdb (Monsignor) on Mar 28, 2013 at 08:26 UTC | |
by Anonymous Monk on Mar 28, 2013 at 19:00 UTC | |
by hdb (Monsignor) on Mar 28, 2013 at 19:10 UTC |
In Section
Seekers of Perl Wisdom