openhab-docs/_addons_transformations/regex
Kai Kreuzer f1727cae7b
updated generated content
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2017-10-18 17:08:32 +02:00
..
readme.md updated generated content 2017-10-18 17:08:32 +02:00

readme.md

id label title type description since install
regex RegEx RegEx - Transformation Services transform Given a source string and a regular expression, use the regular expression to yield a transformed string. 2x auto

{% include base.html %}

RegEx Transformation Service

Given a source string and a regular expression, use the regular expression to yield a transformed string.

If the regular expression is in the format s/<regex>/result/g, replace all occurrences of <regex> in the source string with result and return the result.

If the regular expression is in the format s/<regex>/result/, replace the first occurrence of <regex> in the source string with result and return the result.

If the regular expression contains a capture group, return the captured string. The regular expression in this case is further restricted to isolate a complete line by adding ^ to the beginning and $ to the end.

Examples

With the input string My network does not work.:

regular expression output
s/work/cast/g "My netcast does not cast."
.*(\snot).* " not"