Table of Contents

Search

  1. Preface
  2. Informatica Managed File Transfer Welcome Overview
  3. Dashboard
  4. Resources
  5. Workflows
  6. Task Reference
  7. Services Overview
  8. Users
  9. Logs and Reports
  10. Encryption
  11. System
  12. Appendix
  13. Glossary Terms

Regular Expressions

Regular Expressions

Regular expressions, commonly referred to as regex patterns, can be used to search for and replace sets of characters in a given string a files.
Summary of regular-expression constructs
Construct
Matches
Characters
x
The character x
\\
The backslash character
\0n
The character with octal value 0n (0 <= n <= 7)
\0nn
The character with octal value 0nn (0 <= n <= 7)
\0mnn
The character with octal value 0mnn (0 <= m <= 3, 0 <= n <= 7)
\xhh
The character with hexadecimal value 0xhh
\uhhhh
The character with Unicode value hhhh
\t
The tab character ( '\u0009')
\n
The newline (line feed) character ( '\u000A')
\r
The carriage-return character ( '\u000D')
\f
The form-feed character ( '\u000C')
\a
The alert (bell) character ( '\u0007')
\e
The escape character ( '\u001B')
\cx
The control character corresponding to x
Character Classes
[abc]
a, b, or c (simple class)
[^abc]
Any character except a, b, or c (negation)
[a-zA-Z]
a through z or A through Z, inclusive (range)
[a-d[m-p]]
a through d, or m through p: [a-dm-p] (union)
[a-z&&[def]]
d, e, or f (intersection)
[a-z&&[^bc]]
a through z, except for b and c: [ad-z] (subtraction)
[a-z&&[^m-p]]
a through z, and not m through p: [a-lq-z](subtraction)
Predefined Character Classes
.
Any character (may or may not match line terminators)
\d
A digit: [0-9]
\D
A non-digit: [^0-9]
\s
A whitespace character: [ \t\n\x0B\f\r]
\S
A non-whitespace character: [^\s]
\w
A word character: [a-zA-Z_0-9]
\W
A non-word character: [^\w]
Boundary Catchers
^
The beginning of a line
$
The end of a line
/b
A word boundary
/B
A non-word boundary
/A
The beginning of the input
/G
The end of the previous match
/Z
The end of the input but for the final terminator, if any
/z
The end of the input
Back References
$n
Where n is the nth captured group
Quotation
\
Nothing, but quotes the following character
\Q
Nothing, but quotes all characters until \E
\E
Nothing, but ends quoting started by \Q
Example
String
Search Pattern
Replace Pattern
New Value
abc.txt
(.*)\.txt
$1.csv
abc.csv
abc.txt
(.*)(.)\.(.*)
$1x.$3
abx.txt
abc.txt
(.*)\.(.*) $120150101.$2
$120150101.$2
abc20150101.txt
abc20150101.txt
(.*)\d{8}\.(.*)
$1.$2
abc.txt

0 COMMENTS

We’d like to hear from you!