Alternation

A or B or C...


Alternation is basically boolean logic. One or the other or the other. Alternation uses a vertical bar | to seperate choices called Alternatives.

Example: Frank|Bob|Jimmy would pick either Frank or Bob or Jimmy

CREATED 2016-04-20 16:12:28.0

00-24-D8

UPDATED 2016-04-20 16:12:48.0

Parenthisis (..)


Parenthisis are metacharacters too. They are used to constrain the alternation amoung other things.

If one was looking for a line in a text file that began with the sequence F-i-r-s-t or S-e-c-o-n-d and the expression ^First|Second was used, it would return all lines that began with the sequence of characters, F-i-r-s-t and all lines that contained the sequence of characters S-e-c-o-n-d regardless where on the line the squence of S-e-c-o-n-d appeared.

For this, use parenthesis. ^(First|Second) would produce all lines that begin with either the sequence F-i-r-s-t OR the sequence S-e-c-o-n-d

CREATED 2016-04-20 16:16:32.0

00-24-D9

UPDATED 2016-05-02 13:57:33.0

L
I
N
K
S

DBID: db.wam

Page Server: Ithica

©2019 Leistware.com
        Hello anonymous