Search code examples
regexreplacesublimetextsublimetext2

Is it possible to use regexp as variables to do find and replace in sublime text?


I have a regexp search that looks like this:

'\d*.\d*, \d*.\d*'

I want to change the ' and the ,, but keep the d*. Is this possible in sublime text? If not, what's the easiest way to do this?


Solution

  • This works the same way as most other places where regular expressions are available;

    Group the parts of the pattern that you want to keep, and reference them in the replacement

    Pattern: '(\d*.\d*), (\d*.\d*)' Replacement: $1 $2

    This example will remove the ' and the ,