Casio Naurtech CETerm Ver.5.5 User Manual User Manual

Page 100

Advertising
background image

N

AURTECH

E

MULATORS

&

W

EB

B

ROWSER FOR

W

INDOWS

CE

/

W

INDOWS

M

OBILE




CETerm | CE3270 | CE5250 | CEVT220

Page 100


The special ".*" means to match zero or more characters; the '.' represents any character.



Example 2
We can also specify a fixed number of characters to identify fixed field locations:

Match:

"^T1:.{4}(.{20}).*T2:([0-9]{10})"

Replace:

"Name:\1 Account:\2"


The quantity between curly brackets "{}" is an exact number of characters to match.

The first ".{4}" will match, and ignore, the first four characters of track 1.

The "(.{20})" will match the next 20 characters which can be specified in the replace text
as "\1".

The next ".*" skips past the remainder of track 1 data.

The "([0-9]{10})" says to match exactly 10 digits and make them available as "\2"
because this is the second set of parenthesis.

The "[0-9]" means any character in the set from '0' to '9'. This may also be represented as
"[0123456789]".

Example 3
As a third example, we can identify the data between "delimiter" characters. Often, a cardholder
name is found between '^' characters.

Match:

"\^([^^]+)\^.*T2:.*=([0-9]{20})"

Replace:

"Name:\1 Account:\2"

The leading "\^" means to match the '^' character, not the start of the data.

The backslash '\' removes the "special" meaning of the '^'.

The "([^^]+)" may seem complicated. Remember that the "[...]" identifies a set of
characters to match. If there is a leading '^' in the set, it means to match anything
*except* the characters in the set. For example, "[^abc]" means any characters except for
'a', 'b', and 'c'. The second '^' in the set has *no* special meaning and is interpreted as a
literal '^' character. So, this means to match any characters *except* a '^'.

The plus sign '+' means to match one or more of the characters designated by the set, so
this will match one or more characters up to, but not including, the next '^' character. The
result is that we identify all characters between a pair of '^' characters and assign this to
"\1" for replacement.

After the "T2:" we have ".*=" which will match any characters and then an equal sign.

Following the equal sign is "([0-9]{20})" which will match a 20 digit account number.

Advertising
This manual is related to the following products: