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?
When you want to search and replace specific patterns of text, use regular expressions. They can help you in pattern matching, parsing, filtering of results, and so on. Once you learn the regex syntax, you can use it for almost any language. Press Ctrl+R to open the search and replace pane.
Search functions in Sublime Text support regular expressions, a powerful tool for searching and replacing text. Regular Expressions find complex patterns in text.
Or, if you want to find and replace text in a number of files at once, press Command + Shift + F or Control + Shift + H to open Sublime Text's Find in Files tool that can search and replace across as many files as you have open or select from its menu.
\d for single or multiple digit numbers To match any number from 0 to 9 we use \d in regex. It will match any single digit number from 0 to 9. \d means [0-9] or match any number from 0 to 9. Instead of writing 0123456789 the shorthand version is [0-9] where [] is used for character range.
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 ,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With