# fmapxact, fmapregex

### fmapxact(FilePath, MapName, LookFor)

Search the 'Match' column in the specified file text map and return the 'Return' value for the first exact match.

### fmapregex(FilePath, MapName, LookFor)

Search the 'Match' column in the specified file text map, treating each value in the map as a regular expression.

Return the 'Return' value for the first match for the regular expression.

## Arguments

Argument | Data Type | Description
FilePath | string | Name of the text map file. By default, Inaport will search the directory the profile was loaded from. If the map is not there, specify the full path.
MapName | string | The name of the map to use within the file.
LookFor | string | The string value to match against the 'Match' column in the text map.

## Returns

The matched value, or 'NULL_VALUE' if not match is found.

## Description

These functions are used to look up a value in an XML based map file, and return the match. You might do this, for example, to standardize State names; an incoming file might have 'California', 'Texas' etc, and you really want 'CA', 'TX', ...

The difference between the two functions is how the match is done.

- fmapxact() - exact match between the value and the 'Match' column
- fmapregex() - each row in the 'Match' column is treated as a regular expression, and the LookFor value is tested to see if it is a match for the regular expression.

In each case, the search stops with the first match found.

## Examples

Example | Returns | Description
fmapxact("MyFile.xml", "States", #StateField) | Matched value if found | Search the map 'States' in the file 'MyFile.xml' in the same directory as the profile. Exact match.
fmapregex("c:\dir\myfile.xml", "States", #StateField) | Matched value if found | Treat each value in the Match column as a regular expression and match the value in the StateField against it.

## See Also