Clip Manager 5 Regular Expressions

From myFMbutler wiki
Jump to: navigation, search

Main Page > Clip Manager 5 > Regular Expressions

Contents

Introduction

Clip Managers search and replace supports the use of regular expressions. A regular expression, often called a pattern, is an expression that describes a set of strings.

More information about Regular Expressions can be found at http://en.wikipedia.org/wiki/Regular_expression

Clip Manager makes use of the PCRE library. You may check the PCRE documentation: http://www.pcre.org/

Regular expression syntax

Search Patterns

Pattern Description
. Matches any character except newline.
[a-z0-9] Matches any single character of set.
[^a-z0-9] Matches any single character not in set.
\d Matches a digit. Same as [0-9].
\D Matches a non-digit. Same as [^0-9].
\w Matches an alphanumeric (word) character - [a-zA-Z0-9_].
\W Matches a non-word character [^a-zA-Z0-9_].
\s Matches a whitespace character (space, tab, newline, etc.).
\S Matches a non-whitespace character.
\n Matches a newline (line feed).
\r Matches a return.
\t Matches a tab.
\f Matches a formfeed.
\b Matches a backspace.
\0 Matches a null character.
\000 Also matches a null character because of the following:
\nnn Matches an ASCII character of that octal value.
\xnn Matches an ASCII character of that hexadecimal value.
\cX Matches an ASCII control character.
\metachar ).
(abc) Used to create subexpressions. Remembers the match for later backreferences. Referenced by replacement patterns that use \1, \2, etc.
\1, \2,… Matches whatever first (second, and so on) of parens matched.
x? Matches 0 or 1 x's, where x is any of above.
x* Matches 0 or more x's.
x+ Matches 1 or more x's.
x{m,n} Matches at least m x's, but no more than n.
abc Matches all of a, b, and c in order.
b|c Matches one of a, b, or c.
\b Matches a word boundary (outside [] only).
\B Matches a non-word boundary.
^ Anchors match to the beginning of a line or string.
$ Anchors match to the end of a line or string.


Replacements Patterns

Pattern Description
\0 References the whole found pattern
\1 to \15 References the \1 to \15 the subexpressions.
\t Replaced with a tab.(Char(9) )
\r and \n Replaced with a return (Char (13))
\\ Replaced with a \

Regular Expression Options

Greedy

Greedy means the search finds everything from the beginning of the first delimiter to end of the last delimiter and everything in-between.

example

Text Pattern Greedy ON Greedy OFF
<Step enable="True" id="93" name="Beep"/> ".+" "True" id="93" name="Beep" "True"

Dot Match All

. matches anything including new line.

example

Text Pattern Dot Match All ON Dot Match All OFF
<Step enable="True"

id="93" name="Beep"/>

<.+> <Step enable="True"

id="93" name="Beep"/>

Don't match

Treat target as online

Ignores internal newlines for purposes of matching against '^' and '$'.

Case Sensitive

Specifies if case is to be considered when matching a string.

Regular Expression Search Tips

Tip 1: Exclude _

[^_]DoSQL[^_IS ]

Searches for every "DoSQL" that does not have "_" in front of it and doesn't have "_" or "I" or "S" or a space following it.

Personal tools