Sublime Forum

Regular expressions tutorial

#1

i’d like a tutorial (website or book) that will enable me to make use of sublime’s FIND & REPLACE tools.

0 Likes

#2

You may be interested in this site; it has a lot of information about regular expressions in general, including a tutorial. It’s not Sublime Text specific, but 95% of the information there is still applicable anyway.

3 Likes

#3

This is a great tool to build regexes with visual feedback on what’s going on. https://regex101.com

6 Likes

#4

thanks for the suggestions; as i’m also a bit of an R geek, i’ll also work through the examples at
https://cran.r-project.org/web/packages/stringr/vignettes/regular-expressions.html
but to get help with my specific problem:
i want to replace spaces following text but preceding numbers with tabs

TEXT:
Bishop 1 0 1 1964 1964
Blacher 1 0 1
Blackmore 3 1 2 1926 1963

i can select the target spaces with
[‘a-z’] [‘0-9’]
but i don’t know what to REPLACE them with

0 Likes

#5

Definitely put that into www.regex101.com to see how it works if you want. Regex is a bit of a craft-and-forget thing in my opinion and it’s always good to play in a sandbox a bit if you find yourself tweaking an expression more than three times and still can’t get it to do what you want.

1 Like