16.12.2012 Views

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

egexp<br />

Summary<br />

Examples<br />

The commands that use basic and extended regular expressions are as follows:<br />

Basic ed, expr, grep, sed<br />

Extended awk, grep with -E option, sed with the -E option.<br />

Table 38 summarizes the features that apply to which shell commands:<br />

Table 38. Regular Expression Features (regexp)<br />

Notation awk ed grep -E expr sed<br />

. Yes Yes Yes Yes Yes<br />

^ Yes Yes Yes No Yes<br />

$ Yes Yes Yes Yes Yes<br />

[...] Yes Yes Yes Yes Yes<br />

[::] Yes Yes Yes Yes Yes<br />

re* Yes Yes Yes Yes Yes<br />

re+ Yes No Yes No No<br />

re? Yes No Yes No No<br />

re|re Yes No Yes No No<br />

\d Yes Yes Yes Yes Yes<br />

(...) Yes No Yes No No<br />

\(...\) No Yes No Yes Yes<br />

\< No No No No No<br />

\> No No No No No<br />

\{ \} Yes No Yes No Yes<br />

The following patterns are given as illustrations, along with descriptions of what they<br />

match:<br />

abc Matches any line of text containing the three letters abc in that order.<br />

a.c Matches any string beginning with the letter a, followed by any character,<br />

followed by the letter c.<br />

^.$ Matches any line containing exactly one character (the newline is not<br />

counted).<br />

a(b*|c*)d<br />

Matches any string beginning with a letter a, followed by either zero or more<br />

of the letter b, or zero or more of the letter c, followed by the letter d.<br />

.* [a–z]+ .*<br />

Matches any line containing a word, consisting of lowercase alphabetic<br />

characters, delimited by at least one space on each side.<br />

(morty).*\1<br />

888 z/<strong>OS</strong> <strong>V1R9.0</strong> <strong>UNIX</strong> <strong>System</strong> <strong>Services</strong> <strong>Command</strong> Reference

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!