Hitachi

JP1 Version 12 JP1/Base User's Guide


F.3 Comparison among regular expressions that can be used

The following table lists major items for regular expressions usable with the initial settings, and regular expressions usable in extended regular expressions.

Method

Meaning

In Windows:

(JP1-specific regular expressions)

In UNIX:

(basic regular expressions)#1

In Windows:

(extended regular expressions)#3

In UNIX:

(extended regular expressions)#2

Character string

Signifies the line with the specified string.

Y

Y

Y

Y

^string

Signifies that the specified string is at the beginning of a line.

Y

Y

Y

Y

string$

Signifies that the specified string is at the end of a line.

Y

Y

Y

Y

^string$

Signifies the line that contains the specified string only.

Y

Y

Y

Y

^$

Signifies a blank line.

Y

Y

Y

Y

(period)

Signifies any single character.

Y

Y

Y

Y

.*

A period (.) combined with an asterisk (*) signifies a single character.

Y

Y

Y

Y

[string]

Signifies any of the characters specified in the string enclosed by [ and ].

N

Y

Y

Y

[^string]

Signifies characters other than those specified in the string enclosed by [ and ].

N

Y

Y

Y

[character-character]

Signifies a single character within the range, in the ascending order of character codes.

N

Y

Y

Y

[^character-character]

Signifies a single character out of the range, in the ascending order of character codes.

N

Y

Y

Y

character*

Signifies the string in which the immediately preceding character is repeated at least zero times.

Y

Y

Y

Y

character+

Signifies the string in which the immediately preceding character is repeated at least one time.

N

N

Y

Y

character?

Signifies the string in which the immediately preceding character is not repeated or only one time.

N

N

Y

Y

Character{n}

Signifies the string in which the immediately preceding character is repeated at least n times.

N

N

Y

Y

Character{n,}

Signifies the string in which the immediately preceding character is repeated at least n times.

N

N

Y

Y

Character{n,m}

Signifies the string in which the immediately preceding character is repeated at least n times, but m times or less.

N

N

Y

Y

regular-expression|regular-expression

Signifies either the right or left regular expressions.

N

N

Y

Y

\special-character

Handles a special character as an ordinary character.

Y

Y

Y

Y

(regular-expression)

Groups regular expressions.

N

N

Y

Y

Legend:

Y: Can be used

N: Cannot be used

#1: Only JP1/Base uses basic regular expressions by default. Other JP1 products use different regular expressions. For details on the regular expressions that other products use by default, see the manual for each product.

#2: If regular expressions are extended, the extended regular expressions that are applied differ by OS. HP-UX, Solaris, and AIX use extended regular expressions that conform to the XPG4 standard, and Linux uses extended regular expressions that conform to the POSIX1003.2 standard. For details, see the syntax (regexp or regex).

#3: If regular expressions are extended, the syntax of the XPG4 extended regular expressions is applied. Items that are undefined in the regular expression standard might act differently from the corresponding items for UNIX.