The title is a bit of a mouthful, but what I mean is this:
- I have a bunch of strings like 180347-003.
- I want to search for the hyphen and the three numbers after that (and only match when that hyphen + three number pattern exists).
- I want to replace the hyphen with a comma, but keep the numbers.
What you do is this:
- In the Find field, put parentheses around the part of the regular expression you want to keep (the three numbers).
- In the Replace field, put whatever you want to replace and then backslash 1. That treats whatever is in the parentheses as a group and it will take whatever is matched by the regexp inside the parentheses and print that when replacing.
It’s really not a good explanation but hopefully I can find this again when I need it.