====== RegularExpressions (RegEx) ======
Keyboard Maestro uses [[https://www.keyboardmaestro.com/action/linkthru?regularexpressionreferenceoverview|ICU RegularExpressions]] (aka RegEx or RegExp) which is very similar to PCRE (Perl Compatible RegularExpressions), and you can read their [documentation](https://www.keyboardmaestro.com/action/linkthru?regularexpressionreference) by choosing ICU RegularExpression Reference from the Help menu in Keyboard Maestro.
res in scripts.
==== People have suggested I use regularexpressions to solve a problem, but how? ====
RegularExpressions are a powerful tool for text processing and are fully supported in Keyboard Maestro. You can use regularexpressions to extract or change parts of text or dates or file names.
You can learn more about regularexpressions in various places:
* The BBEdit or TextWrangler
====== Search using RegularExpression Action ======
{{:regex-icon.png?nolink|}}
The //Search using RegularExpression// action allows you to search a clipboard, variable, a file (v8+) or some text (v8+) for a [[:RegularExpressions|regularexpression]] and capture what you find to one or more variab... o use a [[action:For_Each|For Each Action]] as [[:Regular_Expressions#Examples|Shown in this Example]].
{{:action:sea
ing the case.
* Strings, ignoring the case.
* RegularExpression, matching the case.
* RegularExpression, ignoring the case.
Select the source to search using the //Search// pop-... and other tokens to enter in the text area.
For regularexpressions, the replacement can refer to capture groups usi... uch as Monday and replace with Tuesday.
* Use a regularexpression to search through a list of names where the last
he ICU Date Format References web site.
==== ICU RegularExpression References ====
The *ICU RegularExpression References* command in the *Help* menu takes you to the ICU RegularExpression References web site.
==== RegularExpression Unicode Properties ====
The *RegularExpression Unicode Properties* co
a number they will expand to allow a more complex expression to be entered. You can tell that a field accepts... tors, regardless of your desired language.
===== Expressions =====
Keyboard Maestro’s expressions include precedence, nested bracketed expressions, many built-in [[/Functions|functions]], various numeric ba
word break next.
Alternatively, you can use a [[:RegularExpressions|regularexpression]] to match a trigger. The trigger is matched agai... , so there is an implicit \z on the end of the [[:RegularExpressions|regularexpression]]. Note that it would be useless to try to match ... iggers|See all Triggers]]
==== Topics ====
* [[:RegularExpressions]]
==== Forum ====
- [[https://forum.keyboardma
and URL handling. It also offers a very powerful RegularExpression engine built-in. JXA is the same fast JavaScript... JXA with AppleScript=====
====Evaluating simple expressions====
The simplest scripts evaluate an expression and return its value.
**NB** Keyboard Maestro can only ma... xa.png|}}
==Differences to notice: 1. Separating expressions – AppleScript newline vs JavaScript semicolon==
a simplified version of the [[action:Search_using_Regular_Expression|Search using RegularExpression]] action specifically to split the path into the ... e set to /Nowhere (v8.0.3+).
===== See Also =====
==== Actions ====
* [[action:Search_using_Regular_Expression|Search using RegularExpression]]
2+)
* returns text that is matches a specified [[:RegularExpressions|regularexpression]].
* returns text that is does not matches a specified [[:RegularExpressions|regularexpression]].
* returns text that is numerically less than a
pecified string. (v7.2+)
* matches a specified [[:RegularExpressions|regularexpression]].
* does not match a specified [[:RegularExpressions|regularexpression]].
* is numerically less than a specified calculation. (v8+)
*
fter a specified string.
* matches a specified [[:RegularExpressions|regularexpression]].
* does not match a specified [[:RegularExpressions|regularexpression]].
===== See Also =====
=== Actions ===
* [[action:If Then E
pecified string. (v7.2+)
* matches a specified [[:RegularExpressions|regularexpression]].
* does not match a specified [[:RegularExpressions|regularexpression]].
* is numerically less than a specified calculation. (v8+)
*
fter a specified string.
* matches a specified [[:RegularExpressions|regularexpression]].
* does not match a specified [[:RegularExpressions|regularexpression]].
* is numerically less than a specified calculation.
* is num
ely) a specified string.
* matches a specified [[:RegularExpressions|regularexpression]].
* does not match a specified [[:RegularExpressions|regularexpression]].
===== See Also =====
=== Actions ===
* [[action:If Then E