This function removes characters from text a (from left or right) until the regular expression b matches. The function returns the first trimmed text that matches the regular expression. If the regular expression never matches, an empty string is returned.
Parameters
Parameter | Description |
|---|---|
a | Text. |
b | Regular expression. |
c | (optional) "true" if the text should be trimmed from the right side. "false" if the text should be trimmed from the left side. Default: "false". |
Examples
Parameter a | Parameter b | Parameter c | Result |
|---|---|---|---|
000978456008918765 | ^[1-9].* | 978456008918765 | |
000978456008918765 | ^[1-9].* | false | 978456008918765 |
000978456008918765 | ^[1-9].* | true | |
hello, world?!#*** | .*\?$ | true | hello, world? |