You are here: Functions > MAP()

MAP()

MAP() performs a character-by-character comparison of a source string with a specified format string and returns a True or False value. The format string can contain wildcard characters, literal characters or both.

Use MAP() to perform wildcard or literal comparisons in Analyzer, particularly for creating filters that are not based on literal text.

Function Format

MAP(C1,C2)

C1 is the source string to be compared
C2 is the format string.

If C2 is longer than C1, the result will be False. If C2 is shorter, MAP() only compares characters to the length of C2. The remaining characters in the string C1 will not affect the returned value.

MAP() returns True if C1 matches C2. It returns False if C1 does not match C2.

The format string (C2) can contain literal characters, which match only if the same character exists in the same position in the source string. You can also specify the following character types:

Use this:

To do this:

X,x

Match any alphabetic character (a-z, A-Z, European characters)

9

Match any number (0-9)

!

Match any nonblank character

?

Match any character

\

Specify that the following character is a literal, regardless of its value

The alphabetic character type is not case-sensitive. You can use “X” or “x.”

Blanks can be entered as blanks, without “\” in front.

Use “\” before any formatting character that must be literally present in the format string. For example, to specify “X” as literal, enter “\X” in the format string. To specify a backslash as a literal, enter “\\”. A single “\” as the last character in the string C2 will be ignored.

Examples

MAP("ABC123","xxx999") = T

MAP("ABC123","XX999") = F

MAP("A bc123","X XX999") = T

MAP("A bc123","XXX999") = F

MAP("ABC123","ABC999) = T

MAP("ABC123","XXC999") = T

MAP("WXY123","W\XY999") = T

MAP("ABC123","XXX 9999") = F

MAP("A1 B23","XXXX") = F

MAP("A1 B23","!!!!") = F