RegEx for BES Proxy URL Setting

Have you ever wondered what the default pattern matching string for the proxy URL settings in BES means?

.*://.*(:\d*)?(/.*)*(\?.*)?

Well, this is Java RegEx (Regular Expression) language. Find below some examples that help understand the RegEx:

.       matches exactly one character
.*      matches any number of characters (including 0), short for .{0,}
.+      matches one or more characters, short for .{1,}
.?      matches zero or one character, short for .{0,1}
.{7}    matches exactly 7 characters

\d      matches exactly one digit, short for [0-9]
\d*     matches any number of digits (including 0), short for \d{0,}
etc

[a-z]   matches exactly one small letter
[A-Z]   matches exactly one capital letter

(:\d*)? matches a column followed by any number of digits. Element is optional (matches if occurs zero or one time)

(/.*)*  matches a forward slash followed by any number of characters. Element can occour any number of times

(\?.*)? matches a question mark followed by any number of characters. Element is optional (matches if occurs zero or one time)

\.      matches exactly one dot

So the default URL string means:

Any number of characters must be followed by a column. (i.e. http: or https: or ftp:). Then, any number of characters follow (i.e. the fully qualified host name). Optionally, a column and a port number can follow. Then a sequence of forward slashes and characters can follow. Optionally a question mark and any numbers of characters can follow.

One thought on “RegEx for BES Proxy URL Setting”

Leave a Reply

Your email address will not be published. Required fields are marked *