openhab-docs/_transformations/regex
Kai Kreuzer c0efe6050b updated generated content
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2017-03-17 19:56:07 +01:00
..
readme.md updated generated content 2017-03-17 19:56:07 +01:00

readme.md

id label title type description since install
regex RegEx RegEx - Transformations 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"