@MATCHES returns "true" if the first substring of a string matches the given regular expression.
DTP Type:
@MATCHES can be assigned to a DTP of type string, password, member, members, dimension, or dimensions.
Syntax:
@MATCHES(text,regExpr,IgnoreCase)
Parameters:
| Parameter | Description |
|---|---|
text |
Design-time prompt |
regExpr |
See Java docs for "java.util.regex.Pattern" |
IgnoreCase |
Optional. True or False. If left empty, defaults to True. |
Example:
[Matches_Mbr]=@MATCHES([Mbr],[Match_String_Mbr],"true")
Where:
[Mbr] is a promptable DTP member type.
[Match_String_Mbr] is a promptable DTP string.
IgnoreCase is "true".
Assume that the following values are input:
[Mbr]: "P_100"
[Match_String_Mbr] "\p{Alnum}", which is the Java regular expression to return an alphanumeric character.
In this example, [Matches_Mbr] returns "true".