User Tools

Site Tools


Regular_Expressions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Regular_Expressions [2021/04/08 00:16]
peternlewis [Capture Groups]
Regular_Expressions [2022/11/10 03:29]
ccstone [Online Primers & Tutorials]
Line 1: Line 1:
-{{:​regex-icon.png?​nolink |}} 
 ====== Regular Expressions (RegEx) ====== ====== Regular Expressions (RegEx) ======
  
- +Keyboard Maestro uses [[https://www.keyboardmaestro.com/action/linkthru?​regularexpressionreferenceoverview|ICU Regular Expressions]] (aka RegEx or RegExp) which is very similar to PCRE (Perl Compatible Regular Expressions),​ and you can read their [documentation](https://www.keyboardmaestro.com/action/linkthru?​regularexpressionreference) by choosing ICU Regular Expression Reference from the Help menu in Keyboard Maestro.  ​
-Keyboard Maestro uses [[http://userguide.icu-project.org/strings/regexp|ICU Regular Expressions]] (aka RegEx or RegExp) which is very similar to PCRE (Perl Compatible Regular Expressions),​ and you can read their [documentation](http://userguide.icu-project.org/strings/regexp#​TOC-Regular-Expression-Metacharacters) by choosing ICU Regular Expression Reference from the Help menu in Keyboard Maestro.  ​+
  
  
Line 19: Line 17:
 ===== Search Modifiers ===== ===== Search Modifiers =====
  
-The ICU calls these modifiers "[[http://userguide.icu-project.org/strings/regexp#​TOC-Flag-Options|flag options]]"​.+The ICU calls these modifiers "[[https://www.keyboardmaestro.com/action/linkthru?​regularexpressionreferenceflags|flag options]]"​.
  
 The search modifier "​Pattern to Use" shown below is placed at the very beginning of the Search/Find Regular Expression box.\\  ​ The search modifier "​Pattern to Use" shown below is placed at the very beginning of the Search/Find Regular Expression box.\\  ​
Line 56: Line 54:
 ===== ICU 55+ Metacharacters ===== ===== ICU 55+ Metacharacters =====
  
-For the currently complete list, see [ICU Regular Expression Metacharacters](http://userguide.icu-project.org/strings/regexp#​TOC-Regular-Expression-Metacharacters). +For the currently complete list, see [ICU Regular Expression Metacharacters](https://www.keyboardmaestro.com/action/linkthru?​regularexpressionreference).
- +
-**New Metacharacters Available in ICU 55+**(([ICU Regular Expression Metacharacters](http://​userguide.icu-project.org/​strings/​regexp#​TOC-Regular-Expression-Metacharacters)))+
  
 [ICU 55](http://​site.icu-project.org/​download/​55) was released on 2015-04-01, and is available in the follow software versions: [ICU 55](http://​site.icu-project.org/​download/​55) was released on 2015-04-01, and is available in the follow software versions:
Line 66: Line 62:
 These Metacharacters offer some powerful solutions to long-standing RegEx problems. These can replace complicated RegEx patterns previously required, and are recommended for use if you are running the required versions. ​ For example, `\h` and `\R`.  ICU 55 is _not_ available in all RegEx engines. ​ A notable exception is JavaScript (and JXA), even in High Sierra. ​ So if you are using the native Keyboard Maestro Actions that use RegEx, it would be available, but not necessarily in Actions that use Execute Script in another language. ​ It is available in Execute AppleScript Actions that use ASObjC RegEx. These Metacharacters offer some powerful solutions to long-standing RegEx problems. These can replace complicated RegEx patterns previously required, and are recommended for use if you are running the required versions. ​ For example, `\h` and `\R`.  ICU 55 is _not_ available in all RegEx engines. ​ A notable exception is JavaScript (and JXA), even in High Sierra. ​ So if you are using the native Keyboard Maestro Actions that use RegEx, it would be available, but not necessarily in Actions that use Execute Script in another language. ​ It is available in Execute AppleScript Actions that use ASObjC RegEx.
  
-^   New Metacharacters in ICU 55+(([ICU Regular Expression Metacharacters](http://userguide.icu-project.org/strings/regexp#​TOC-Regular-Expression-Metacharacters)))   ^^^+^   New Metacharacters in ICU 55+(([ICU Regular Expression Metacharacters](https://www.keyboardmaestro.com/action/linkthru?​regularexpressionreference)))   ^^^
 ^ Character ^ Alternate Expression\\ (Pre ICU 55) ^ Description ^ ^ Character ^ Alternate Expression\\ (Pre ICU 55) ^ Description ^
 | `\h` | `[^\S\r\n\f]` | Match a Horizontal White Space character.\\ They are characters with Unicode General Category of Space_Separator plus the ASCII tab (\u0009). | | `\h` | `[^\S\r\n\f]` | Match a Horizontal White Space character.\\ They are characters with Unicode General Category of Space_Separator plus the ASCII tab (\u0009). |
Line 135: Line 131:
 ==== General ==== ==== General ====
  
-  - [[http://userguide.icu-project.org/strings/regexp|ICU Regular Expressions]]+  - [[https://www.keyboardmaestro.com/action/linkthru?​regularexpressionreferenceoverview|ICU Regular Expressions]]
   - [ICU Unicode Properties for Regular Expressions](http://​unicode.keyboardmaestro.com)   - [ICU Unicode Properties for Regular Expressions](http://​unicode.keyboardmaestro.com)
   - [[https://​en.wikipedia.org/​wiki/​Regular_expression|Wikpedia Regular Expression article]]   - [[https://​en.wikipedia.org/​wiki/​Regular_expression|Wikpedia Regular Expression article]]
Line 167: Line 163:
 ==== Online Primers & Tutorials ==== ==== Online Primers & Tutorials ====
  
-  - [[http://​www.agillo.net/​regex-primer-part-1/​|Regex Primer : Part 1]] 
-  - [[http://​www.agillo.net/​regex-primer-part-2/​|Regex Primer : Part 2]] 
   - [Regular Expressions Quick Start](http://​www.regular-expressions.info/​quickstart.html)   - [Regular Expressions Quick Start](http://​www.regular-expressions.info/​quickstart.html)
   - [[http://​www.codeproject.com/​KB/​dotnet/​regextutorial.aspx|CodeProject.com RegExTutorial]]   - [[http://​www.codeproject.com/​KB/​dotnet/​regextutorial.aspx|CodeProject.com RegExTutorial]]
  
 Keywords: ​ //Regular Expression, RegEx, RegExp, Find, Replace, Match// Keywords: ​ //Regular Expression, RegEx, RegExp, Find, Replace, Match//
Regular_Expressions.txt · Last modified: 2022/11/10 03:29 by ccstone