Bare Metal Software Home

Last updated May 04 2016 11:09:41
Copyright © 2003, 2004, 2005, 2006 Bare Metal Software Pty Ltd.

Home | BareTail | BareTailPro | BareGrep | BareGrepPro | Buy Now | News | Contact Us

Regular Expression (Regex) Reference

Introduction

The regex syntax and semantics implemented in BareGrep are common to PHP, Perl and Java. BareGrep provides a common subset of functionality available in these languages.

Logical Operators

XY

Catenation

X then Y

X|Y

Alternation

X or Y

(?:X)

Group

Grouping and operator precedence override

(X)

Capturing Group

Grouping and operator precedence override with the additional side-effect of capturing the string for display in a separate column in BareGrep. This is sometimes called a capturing group.

Characters and Escapes

\a

Alert character (bell)

\cx

Control-x character

For example:

\cM

would be equivalent to:

Control-M

Or character ASCII code 0D hexidecimal.

\d

A digit

Any character in the set:

[0-9]

\D

Any non-digit

Any character in the set:

[^0-9]

\e

Escape character

\f

Form feed character

\n

New line character

\r

Carriage return character

\s

Any whitespace character

\S

Any non-whitespace character

\t

Tab character

\nnn

The character with octal value nnn

\w

Any word character

[0-9_A-Za-z]

\W

Any non-word character

[0-9_A-Za-z]

\xhh

The character with hexidecimal value hh

.

Any character

x

The literal character x

Character Classes

[abc]

Character Set

Character a, b or c

[^abc]

Inverse Character Set

Any character other than a, b or c

[a-b]

Character Set Range

Any character in the range a to b

Quantifiers

X*

Set Closure

X zero or more times

X+

Kleene Closure

X one or more times


Want to know about new releases?


We only send email when we release a new version (Privacy Policy)

Our product news is also provided as an RSS Bare Metal Software RSS News Feed feed.

Home | BareTail | BareTailPro | BareGrep | BareGrepPro | Buy Now | News | Contact Us

Copyright © 2003, 2004, 2005, 2006 Bare Metal Software Pty Ltd.