[sf-perl] regex help

David Fetter david at fetter.org
Tue Oct 11 12:02:55 PDT 2011


On Tue, Oct 11, 2011 at 01:57:48PM -0500, Richard Reina wrote:
> I have a file that has list of some sentences.  Some of them are numbered so
> I am going in circles trying to figure out how to remove the numbering.  The
> file is in the following format:
> 
>     12. blah blah, blah blah blah. blah.
>  29. blah blah, blah.
>    19. blah blah blah.

This looks to me like you might need:

s{
    \s*    # Any number of whitespace characters.
    \d+    # Any positive number of digits.
    \.     # Literal period.
    \s*    # Any number of whitespace characters.
    (.*)   # The rest(TM)
}
{
    $1
}x;

Cheers,
David.
-- 
David Fetter <david at fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter at gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


More information about the SanFrancisco-pm mailing list