bmerri19 wrote:Attempting to remove the dash in between a date string formatted as "04-01-10", but there is also text before and after the date. I can find the pattern via:
(\b\d{2}-\d{2}-\d{2}\b)
Stuck in removing the two dashes and keeping all existing text.
Thanks,
Brian
Hi Brian, welcome.
Please provide always full examples of your file names, so we have an change to help you.
Here are a few guesses of me:
Form:
Before 04-01-10 After.txt
To:
Before 040110 After.txt
Use:
Remove(5) Chars:[-]
Form:
Before 04-01-10 After.txt
To:
Before 04 01 10 After.txt
Use:
Repl.(3)
Replace: -
With: blank
Form:
Before 04-01-10 After - test.txt
To:
Before 040110 After - test.txt
Use:
RegEx(1)
Match: (.*?)-(.*?)-(.*)
Repla: \1\2\3
or better for all kind of dashes on different places:
Form:
Before - 04-01-10 After - test.txt
Before 04-01-10 After - test.txt
Before-Test 04-01-10 After.txt
To:
Before - 040110 After - test.txt
Before 040110 After - test.txt
Before-Test 040110 After.txt
Use:
RegEx(1)
Match: (.*\d\d)-(\d\d)-(\d\d.*)
Repla: \1\2\3 [ or \1 \2 \3 or \1.\2.\3 , whatever one likes ]