Regular Expression can be used in a variety of ways in OneCloud. Here is a high-level table of operators to be aware of.


What does it do?




Matches beginning of line


abc, abcdef.., abc123


Matches end of line


my:abc, 123abc, theabc


Match any character


abc, asg, a123c


OR operator


abc or xyz


Capture anything matched


Captures 'a' and 'c'


Matches anything contained in brackets


a,b, or c


Matches any characters between 'a' and 'z' but does not include any upper case.


bc, mind, xyz


Matches any value between 0 and 3




The exact 'x' amount of times to match




Match 'x' amount of times or more


abcabc, abcabcabc


Greedy match that matches everything in place of the *


abc, abbcc, abcdc


Matches character before + one or more times


ac, aac, aaac,


Matches the character before the ? zero or one times. Also, used as a non-greedy match


ac, abc


Escape the character after the backslash or create an escape sequence.


a c
(matches the space)

Regular Expressions can be extremely complex, but they are very flexible and powerful and can be used to perform operations and comparisons that cannot be done using exact matches.

Please see the following examples for basic regular expression usage. For a complete description, please visit

^ and $

First of all, let's take a look at two special symbols: '^' and '$'. These symbols indicate the start and the end of a string, respectively:


matches any string that starts with "The".

"of despair$"

matches a string that ends in with "of despair".


a string that starts and ends with "abc" - effectively an exact match comparison.


a string that has the text "notice" in it.

If neither of these two characters is used, it's established that the pattern may occur anywhere inside the string -- nothing is being "hooked" to the edges.

Asterisk * Plus + Question Mark ?

In addition, the symbols '*', '+', and '?', denote the number of times a character or a sequence of characters may occur. What they mean is: "zero or more", "one or more", and "zero or one." Here are some examples:


matches a string that has an "a" followed by zero or more b's ("ac", "abc", "abbc", etc.)


same, but there's at least one "b" ("abc", "abbc", etc., but not "ac")


there might be a single "b" or not ("ac", "abc" but not "abbc").


a possible "a" followed by one or more "b"s at the end of the string:

Matches any string ending with "ab", "abb", "abbb" etc. or "b", "bb" etc. but not "aab", "aabb" etc.

{ Braces }

Bounds appear inside braces and indicate ranges in the number of occurrences:


matches a string that has an a followed by exactly two b's ("abb")


there are at least two b's ("abb", "abbbb", etc.)


from three to five b's ("abbb", "abbbb", or "abbbbb")

📓 Always specify the first number of a range (i.e., "{0,2}", not "{,2}"). Also, as you might have noticed, the symbols '*', '+', and '?' have the same effect as using the bounds "{0,}", "{1,}", and "{0,1}", respectively.

To quantify a sequence of characters, put them inside parentheses:


matches a string that has an a followed by zero or more copies of the sequence "bc"


one through five copies of "bc."

| The OR Operator

There's also the '|' symbol, which works as an OR operator:


matches a string that has either "hi" or "hello" in it


a string that has either "bef" or "cdef"


a string that has a sequence of alternating "a"s and "b"s ending in a "c"

Period .

A period ('.') stands for any single character:


matches a string that has an a followed by one character and a digit


a string with exactly 3 characters

[ Bracket Expressions ]

Specify which characters are allowed in a single position of a string:


matches a string that has either an a or a b (that's the same as "a|b")


a string that has lowercase letters 'a' through 'd' (that's equal to "a|b|c|d" and even "[abcd]")


a string that starts with a letter


a string that has a single-digit before a percent sign

",[a-zA-Z0- 9]$"

a string that ends in a comma followed by an alphanumeric character

Circumflex ^
Unwanted characters may also be listed. Use a '^' as the first symbol in a bracket expression (i.e., "%[^a- zA-Z]%" matches a string with a character that is not a letter between two percent signs).

In order to be taken literally, always escape the characters "^.[$()|*+?{\" with a backslash ('\'), as they have special meaning. On top of that, always escape the backslash character itself.

Lastly, please note that bracket expressions are an exception to that rule and inside of them, all special characters, including the backslash ('\'), lose their special powers (i.e., "[*\+?{}.]" matches exactly any of the characters inside the brackets). If there is a need to include a literal ']' in the list, make it the first character (following a possible '^'). To include the literal '-', make it the first or last character, or the second endpoint of a range.

Did this answer your question?