Page 1 of 1

Wildcard help required please :)

PostPosted: Thu Mar 12, 2020 6:37 pm
by SPARKY1000
Hello,

I cant seem to find a way to do the following:

I have the following examples in a filename -

(20821
(10525
(20745
(15789

I require a closed bracket at the end of the number sequence to match the start of it. If I could use the * as a wildcard it would be- (***** to (*****) and Id be laughing!

There are words in the file name too, before and after the numbers. (these are all different length words).
Every number is unique.
The number sequence is always 5 digits.



Any help is appreciated.

Re: Wildcard help required please :)

PostPosted: Thu Mar 12, 2020 7:31 pm
by therube
1:RegEx:
Code: Select all
Match:  ^(\(\d\d\d\d\d)(.*)
Replace:  \1)\2


Match names that start with a paren followed by 5 digits.
Keep that, stick a closing paren after the 5th digit, & keep everything else.

Code: Select all
(20821            (20821)
(20821 123456     (20821) 123456
(20821abc123456   (20821)abc123456

Re: Wildcard help required please :)

PostPosted: Thu Mar 12, 2020 7:57 pm
by SPARKY1000
Thank you so much. You have saved me a lot of time!