Like the title says I am trying to create some regex that selects anything but the numbers inside the square brackets. For example:
6483463456[1234]623235[456]783467546[789]67467467
I would like to replace everything but the numbers inside the square brackets with nothing (only be left with the numbers in the brackets). I want this:
[1234][456][789]
Here is what I have so far, but it doesn’t work:
[^\[.*\]]
The code above finds the numbers individually, including the numbers inside the brackets.
\[(.*?)\]
The code above does nothing, but looks right.
Am I close?
You’ll want to pick up the numbers around the square brackets, then only capture the numbers in between the square brackets (along with the brackets) to get rid of the rest.
Additionally, to match only digits, you should use
\dinstead of..Find:
Replace all with: