When I say documentation, I mean to document what are the symbols and the meanings in a regex literal expression, such as what does /d
mean, or ?
,+
, etc.
1 Like
Swift's regex implementation follows several regex standards, so the documentation for any of them will likely work. Here are some interactive tutorials.. I can't vouch for their quality, but it seems like a gentle intro.
2 Likes
I personally like to use a good online regex tool like https://regex101.com/ for trying things out.
In addition to an entry tutorial you should have a look at the very useful lookahead feature. E.g. when you do replacements, this feature can save you from having to apply a replacement several times. (Note that at least with the new regex literals, look-behinds are not available in Swift, only look-aheads.)
1 Like
Each language has its own "flavor" for (literal) regex syntax.
- Swift is closely related to ICU
Regular Expressions | ICU Documentation - A dedicated site with exhaustive info
https://www.regular-expressions.info/ - Perl is the father of all that is regex
perlre - Perl regular expressions - Perldoc Browser - Interactive sandbox to test your regexes
https://regex101.com/ - An introductory regex puzzle game
Save 40% on Copy Editor: A RegEx Puzzle on Steam