pxContainsViaRegex

Hello. Can you please specify the exact expression for the pxContainsViaRegex function? I need to validate the string property Client.FullName text without any numbers: [0-9] but missing some symbol or its place

Hello @AnnaG2838 I’ve changed your Pega Academy post to be a product question as you appear to be asking for documentation about that validation expression.

A quick Google search brings up several examples which should help you further.

Below article has Examples of Pega 7 String Manipulation with Expressions and Functions

See section ‘Substring Search’.

  • String.pxContainsViaRegex is used to search for the occurrence of a given substring within a string using a regular expression. For details on regular expressions, see the java.util.regex.Pattern class documentation.
  • In this example, a regular expression, \d{3}-\d{3}-\d{4}, is used to search for 10-digit phone numbers in a given String. Note that the ** character needs to be escaped as per Java syntax, using \.

@String.pxContainsViaRegex(“phone=345-444-0001|name=smith”, “\d{3}-\d{3}-\d{4}”, true)

(returns true)

See:

https://www.pegaxchange.com/2017/06/12/pega-7-string-manipulation-expressions/

Other community posts about pxContainsViaRegex:

Can we write regular expression in expression builder. | Support Center

How can I implement my requirement using pxContainsViaRegex | Support Center

what is the best funtion to validate that the given string is an integer | Support Center

Allow backslash (\) during special characters validation | Support Center

I hope that helps.

Hi @AnnaG2838 ,

You can use this @pxContainsViaRegex(Client.FullName,“[0-9]”,true)

Thanks,
Kamineni Surya Prakash