Delete all the character before the number

Advanced Renamer forum
#1 : 14/02-15 09:41
Splitting
Splitting
Posts: 3
Good morning, I searched in the forum but I found nothing about it...
What I have to do is to remove all the text before a number string and add a prefix to it... basically...

FROM
SOSUPREME-01178_NAVY_B.jpg

TO
SO01178 NAVY B.jpg

The word supreme change as the number of character before the digit.

Could you help me?
Thanks in advance.
Split!


14/02-15 09:41
#2 : 16/02-15 10:53
Tester123
Tester123
Posts: 92
The title and explanation of the request do not tie up strictly with the example (for example, the underscores are also replaced with spaces in the example), so based mainly on the example you've given and reading between the lines a little, try this:

Add Method: Replace
Text to be replaced: (\w+)-(\d+)_([^_]*)_(.*)
Replace with: Prefix$2 $3 $4
Use regular expressions: Tick

Hint: Substitute whatever prefix you want in the string 'Prefix', e.g. with 'SO' as in your example.

Note: there are many ways to write the regular expression, so if this doesn't fit your scenario, then please add a more detailed request (e.g. which sections are always fixed, which are changed/to be removed, etc).


16/02-15 10:53 - edited 16/02-15 11:01
#3 : 23/02-15 10:29
Splitting
Splitting
Posts: 3
Reply to #2:
yesss... got it my friend... I change something in your code and now it go straight to the point...
here is what I change


Add Method: Replace
Text to be replaced: (\w+)-(\d+)_(.*)
Replace with: SO$2_$3
Use regular expressions: Tick

as I have to upload the images in my website I decided to leave the underscores where they are...
Thank you so much for your reply...

To the moderator... I made a mistake and open a new thread
http://www.advancedrenamer.com/forum_thread?for um_id=2101

Could you please remove it?
Thanks,
SPLIT


23/02-15 10:29
#4 : 23/02-15 15:50
Tester123
Tester123
Posts: 92
Reply to #3:
Glad to have pointed you in the right direction, and well done for managing to change the expression to suit your needs. Regular expressions, while supremely powerful, are not the easiest things to read or understand even for a simple case like this. Can't have it all, I guess!


23/02-15 15:50 - edited 23/02-15 15:52