Insolita
Posted on November 2, 2020
Easy, with regex search!
- Press Ctrl+R for show replace bar
- Enable regex mode (button looks like .* near search field)
- Use regex in search field:
'(.+)'\s=>\s'(.+)',
- Use expression for replace:
'$2' => '$1',
You can see a tooltip with a value that will be after replace
It is possible even you have different quotes and spaces between arrow
Use regex
(?:'|")(.+)(?:'|")\s{0,}=>\s{0,}(?:'|")(.+)(?:'|"),
And the same replace expression '$2' => '$1',
Named capture groups also available:
Use regex
(?:'|")(?<src>.+)(?:'|")\s{0,}=>\s{0,}(?:'|")(?<tgt>.+)(?:'|"),
And the same replace expression '${tgt}' => '${src}',
💖 💪 🙅 🚩
Insolita
Posted on November 2, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.