by Stefan » Wed Oct 23, 2013 3:39 pm
Hi and welcome Brian.
First, you don't have to escape the hyphen.
Second, RegEx is a pattern matching system, you have to tell him exactly what you want to match.
In your second example, "(.+)\-(\d)(.+)", you match one digit, followed by one-or-more of ANY sign, this includes punctuation, chars and digits.
Also you first example "(.+)\-(\d\d)(.+)" would match two-or-more digits, as \d\d will match two digits and .+ will match another digits, or signs or chars.
The RegEx help distributed with BRU do not describe every available expression possibility. Read a good RegEx tutorial
or at least the last post in the thread > Board index ‹ Bulk Rename Utility ‹ Regular Expressions > Getting help with Regular Expressions
One solution for you would be to match one digit, followed by a not-a-digit sign by using "\D" like (.+)-(\d)(\D.+)
RegEx(1)
Match: (.+-)(\d)(\D.+)
Repla: \100\2\3
or
RegEx(1)
Match: (.+-)(\d\D.+)
Repla: \100\2
.