In sublime text, I need to replace all instances of:
rs('???????')
with
$rs['??????']
(keeping the ??????? part the same). I'm a regex virgin and I've only got as far as locating the regex button on the find and replace panel.
How is this possible.
To use Find and Replace in Sublime Text 3, you can either click “Find” in the top-bar, then select “Replace” from the list, or you can press the keyboard shortcut Ctrl+H – the same way it works in, for example, Microsoft Office Word.
Search functions in Sublime Text support regular expressions, a powerful tool for searching and replacing text. Regular Expressions find complex patterns in text.
The REGEXREPLACE( ) function uses a regular expression to find matching patterns in data, and replaces any matching values with a new string. standardizes spacing in character data by replacing one or more spaces between text characters with a single space.
In regular expressions, the period ( . , also called "dot") is the wildcard pattern which matches any single character. Combined with the asterisk operator . * it will match any number of any characters.
Find regex:
rs\('(.*?)'\)
Replace:
$rs['$1']
Beware that this will expect anything inside the quotes; if it isn't what you need, please tell me :)
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