Find and Replace using Regular Expressions in SublimeText

preview_player
Показать описание
Watch how Find and Replace functionality in SublimeText can be combined with Regular Expressions to provide us with a powerful manipulation tool.

In this video, we are adding a title attribute for each one of our anchor tags, which contains the text from our tag.

Explanation:

. : Finds any character except newline.

* : Finds 0 or more of the previous pattern.

(.*) : Creates a capturing group containing every possible character.

$1 and $2: Point back to the first and second capturing groups found by our regular expression.
Рекомендации по теме
Комментарии
Автор

Was looking for how to include the (.*) result back into the replace section.
Good to see it's as simple as $1. Thanks!

EchoMerrill
Автор

Thank you, this is exactly was I was looking for on the value to replace with $1 and $2

reedyseth
Автор

Saved me a lot of frustration with inverting some tags in automatically generated tags by InDesign.
Editing an EPUB with horrible code SUCKS!
Thanks for the

MatiasBaldanza
Автор

could not see the changes you made - way too small

bjan