Example of using the MATCH_REG function
The following examples demonstrate how to use regular expressions in arguments of the MATCH_REG function.
1. Converting values to ○ if their size is 7 bytes; otherwise, converting them to ×

Figure A.55 Example of using the MATCH_REG function with regular expressions (1)
2. Converting values to TRUE if they consist entirely of fullwidth katakana characters; otherwise, converting them to FALSE

Figure A.56 Example of using the MATCH_REG function with regular expressions (2)
3. Converting values to OK if they are 0 or 1; otherwise, converting them to NG

Figure A.57 Example of using the MATCH_REG function with regular expressions (3)
4. Converting values to OK if they are 4-digit halfwidth numeric values; otherwise, converting them to NG

Figure A.58 Example of using the MATCH_REG function with regular expressions (4)
5. Converting values to OK if they are 4-digit fullwidth numeric values; otherwise, converting them to NG

Figure A.59 Example of using the MATCH_REG function with regular expressions (5)
6. Converting postal codes to OK if they are in the correct format; otherwise, converting them to NG

Figure A.60 Example of using the MATCH_REG function with regular expressions (6)
7. Converting character strings to OK if they match ABCxxx; otherwise, converting them to NG (Begins-with match)

Figure A.61 Example of using the MATCH_REG function with regular expressions (7)
8. Converting character strings to OK if they match xxxABC; otherwise, converting them to NG (Ends-with match)

Figure A.62 Example of using the MATCH_REG function with regular expressions (8)
9. Converting character strings to OK if they include ABC; otherwise, converting them to NG (Include)

Figure A.63 Example of using the MATCH_REG function with regular expressions (9)
10. Converting character strings to OK if they do not include ABC; otherwise, converting them to NG (Include)

Figure A.64 Example of using the MATCH_REG function with regular expressions (10)
11. Converting character strings to OK if they begin with A; otherwise, converting them to NG

Figure A.65 Example of using the MATCH_REG function with regular expressions (11)
To convert null to NG, use MATCH_REG{^[^A],OK,NG}.
12. This example converts character strings to OK if the pair of character strings separated by a halfwidth space match, and converts the pair to NG if they do not match. This regular expression can be used to combine different item data into a variable in order to check whether the pair has the same data. Using the condition to compare item values can also be used for such data extraction, but this method allows the same even when there are numerous conditions.

Figure A.66 Example of using the MATCH_REG function with regular expressions (12)