diff --git a/episodes/01-regular-expressions.md b/episodes/01-regular-expressions.md index 5bcbc719..aae6481c 100644 --- a/episodes/01-regular-expressions.md +++ b/episodes/01-regular-expressions.md @@ -29,7 +29,7 @@ Since regular expressions defines some ASCII characters as "metacharacters" that > Most regular expression implementations employ similar syntaxes and metacharacters (generally influenced by the regex syntax of a programming language called Perl), and they behave similarly for most pattern-matching in this lesson. But there are differences, often subtle, in each, so it's always a good practice to read the application or language's documentation whenever available, especially when you start using more advanced regex features. Some programs, notably many UNIX command line programs (for more on UNIX see our '[Shell Lesson](https://librarycarpentry.org/lc-shell/)'), use an older regex standard (called 'POSIX regular expressions') which is less feature-rich and uses different metacharacters than Perl-influenced implementations. For the purposes of our lesson, you don't need to worry too much about all this, but if you want to follow up on this see [this detailed syntax comparison](https://gist.github.com/CMCDragonkai/6c933f4a7d713ef712145c5eb94a1816). {: .callout} -A very simple use of a regular expression would be to locate the same word spelled two different ways. For example the regular expression `organi[sz]e` matches both "organise" and "organize". But it would also match `reorganise`, `reorganize`, `organises`, `organizes`, `organised`, `organized`, etc. +A very simple use of a regular expression would be to locate the same word spelled two different ways. For example the regular expression `organi[sz]e` matches both `organise` and `organize`. But because it locates all matches for the pattern in the file, not just for that word, it would also match `reorganise`, `reorganize`, `organises`, `organizes`, `organised`, `organized`, etc. ### Learning common regex metacharacters Square brackets can be used to define a list or range of characters to be found. So: