Remove anything before [0-9] from a string

A swapping-ground for Regular Expression syntax

Remove anything before [0-9] from a string

Postby DavidLago » Wed May 11, 2016 1:34 pm

Well, for some reason, this regex function is not working.

Blood Ceremony [2008] Blood Ceremony
Blood Ceremony [2011] Living With The Ancients
Blood Ceremony [2013] The Eldritch Dark

I need to remove everything that stands before [0-9], so they all should end up looking like "[2008] Blood Ceremony".

Shouldn't this do the trick?
match: ^(.*)(\[\d{4}\])$
or this?
match: ^(.*)(\[[0-9]\])$
and
replace: \1
DavidLago
 
Posts: 2
Joined: Wed May 11, 2016 1:16 pm

Re: Remove anything before [0-9] from a string

Postby DavidLago » Wed May 11, 2016 1:53 pm

Think I got this working. Sorry about the new topic...

^(.*)(\[\d{4}\])((?<=\]).*)

/2/3

Hope this thread at least helps someone :)
DavidLago
 
Posts: 2
Joined: Wed May 11, 2016 1:16 pm


Return to Regular Expressions