Remove text between two periods?

A swapping-ground for Regular Expression syntax

Remove text between two periods?

Postby VetonD1 » Sun Nov 16, 2014 10:09 pm

Hi guys,

I'm really terrible at this, so I decided to ask for help.
I need to remove the text between the first and second period (including the second period).

example:
12. Mary Had a Little Lamb. Big Bad Wolf.mp3
to
12. Big Bad Wolf.mp3

Thank you.
VetonD1
 
Posts: 1
Joined: Sun Nov 16, 2014 9:45 pm

Re: Remove text between two periods?

Postby Stefan » Mon Nov 17, 2014 4:24 pm

FROM:
12. Mary Had a Little Lamb. Big Bad Wolf.mp3

TO:
12. Big Bad Wolf.mp3


RULE:
remove the text between the first and second period (including the second period)



TRY:

Common usable:
RegEx(1)
FIND: ^(.+?\. )(.+?\. )(.+)$
REPL: \1\3

Or more to the point for you example with two leading digits:
RegEx(1)
FIND: ^(\d\d\. )(.+?\. )(.+)$
REPL: \1\3

Or even for different amount of leading digits:
RegEx(1)
FIND: ^(\d+\. )(.+?\. )(.+)$
REPL: \1\3



.
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU


Return to Regular Expressions