Remove all Characters after Group of Digits

A swapping-ground for Regular Expression syntax

Remove all Characters after Group of Digits

Postby tafkam4055 » Sun Sep 08, 2019 10:53 pm

Hi All,

Any help would be really useful and appreciated

I've tried some RegEx stuff, but it's beyond me :/

So I have my comic Collection I'm looking to rename, I used to add things like Volume, Publisher & Year after the Issue Number. Realize now it looks too messy for me.

I'm looking to Erase all characters after the first group of Digits with a space in front of it
Digit group might be 2-4 characters long. I hope this makes sense

Example:

Spider-Man 002 2009 Vol 4 Marvel -> Spider-Man 001
BatMan 02 DC Vol 3 2014 -> BatMan 02

Again any help would be amazing
tafkam4055
 
Posts: 2
Joined: Sun Sep 08, 2019 10:42 pm

Re: Remove all Characters after Group of Digits

Postby therube » Mon Sep 09, 2019 12:02 pm

I think this will do it...


1:RegEx
Code: Select all
Match:  (\D.*?\s\d+)\s
Replace:  \1


non-digit, followed by anything, non-greedy, followed by a space & a set of digit(s), removing the following space & everything else
therube
 
Posts: 638
Joined: Mon Jan 18, 2016 6:23 pm

Re: Remove all Characters after Group of Digits

Postby tafkam4055 » Tue Sep 10, 2019 5:36 pm

Thank you so much!!
You've saved me so much time
tafkam4055
 
Posts: 2
Joined: Sun Sep 08, 2019 10:42 pm


Return to Regular Expressions