|
Regular Expressions |
||||||
|
Home
Products Product Comparisons Features Screen Shots Downloads Updates Free Licenses Support Editors Java HTML Perl JSP JavaScript PHP VBScript Velocity XML |
A regular expression is a pattern that describes what to match during a search. It is often called a regex, regexp or even just RE. The pattern is compiled by a regex engine before it used to match a sequence of characters. The regex engine in JPad Pro and SitePad Pro uses a syntax that is compatible with the regular expression syntax in Perl 5 (plus extensions). If you need more help using regular expressions we recommend that you search online for regular expression help. If you are new to regular expression we recommend Web Reference's Regular Expression Tutorial. Unless you know Perl, we do not recommend that you start with Perl regular expression tutorials. If you need more information you may want to take a look at Mastering Regular Expressions, a 400 page book published by O'Reilly. Some Examples
Regular Expression SyntaxAll characters are literals (a literal is a character to
match when searching) except one of the following:
The The repeat characters are Parentheses are used for grouping and reporting submatches. If you do
not want the group reported you can used the non-reporting syntax
Lookahead assertions are provided by Alternatives are separated by a Sets let you specify a set of characters that can match any single
character that is a member of the set. Sets are delimited by
Entities include the following character classes:
alnum - any alpha numeric character
alpha - any alphabetical character a-z and A-Z
blank - any blank character, either a space or a tab
cntrl - any control character
digit - any digit 0-9
graph - any graphical character
lower - any lower case character a-z
print - any printable character
punct - any punctuation character
space - any whitespace character
upper - any upper case character A-Z
xdigit - any hexadecimal digit character, 0-9, a-f and A-F
word - any alphanumeric character plus the underscore
unicode - any character whose code is greater than 255
To specify a character class use the syntax Line and buffer anchors
^ matches the null string at the start of a line
$ matches the null string at the end of a line
\` matches the start of the file
\A matches the start of the file
\' matches the end of the file
\z matches the end of the file
\Z matches the end of the file
Back references let you refer to a previous sub-expression that has
already been matched. A back reference consists of the escape character
Escapes include the following:
\s matches any [:space:]
\S matches any [^[:space:]]
\d matches any [:digit:]
\D matches any [^[:digit:]]
\l matches any [:lower:]
\L matches any [^[:lower:]]
\u matches any [:upper:]
\U matches any [^[:upper:]]
\w matches any [:word:]
\W matches any [^[:word:]]
\< matches the null string at the start of a word
\> matches the null string at the end of the word
\b matches the null string at either the start or the end of a word.
\B matches a null string within a word
You can use the quote operator Regular Expression Implementation NotesTo match the tilde you will need to use the expression
To match new lines just use
|
||||||
|