P Conversion


The P code returns a value if it matches one of the specified patterns. Patterns can be combinations of numeric and alphabetic characters and literal strings.

 

SYNTAX

P{#}(element){;(element)}...

 

SYNTAX ELEMENTS

# returns null if the source matches the pattern, or the source if it does not.

element is one or more of the following:

nA tests for n alphabetic characters
nC tests for n alphabetic or numeric characters
nN tests for n numeric characters
nP tests for n printable characters
nX tests for n characters
"literal" tests for the presence of the literal

 

NOTES

If the value does not match any of the patterns, a null will be returned.

 

INPUT CONVERSION

Input conversion does not invert. It simply applies the pattern matching to the input data.

 

EXAMPLE 1

P(2A"*"3N"/"2A)

Will match and return AA*123/BB or xy*999/zz. Will fail to match AAA*123/BB or A1*123/BB, and will return null.

 

EXAMPLE 2

P(2A"*"3N"/"2A);(2N"-"2A)

Will match and return AA*123/BB, xy*999/zz, 99-AA or 10-xx. Will fail to match AA&123/BB, A1*123/BB, 9A-AA or 101-xx, and will return null.


jQL