Question
Morgan Stanley
IN
Last activity: 4 Oct 2018 13:54 EDT
Can we write regular expression in expression builder.
Just curious to know if we have any support for regular expression in Pega.
I mean can we write a when rule which checks for Words starting with ABC/123 etc..
***Updated by Moderator: Marissa to update categories***
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Areteans Technologies
AU
Use below expression wherein you can plugin Regex:
pxContainsViaRegex
pxReplaceAllViaRegex
-
Matheswaran Ravichandran
Morgan Stanley
IN
Thanks Dharanitharan.
This is what i was looking for.
Areteans Technologies
AU
Always Welcome!
Booz Allen Hamilton
US
HI
Please can i know the format in which it has to be used.
Thanks
IKOR
AU
Hi Nalin,
Please find the format for the expressions mentioned above
For pxReplaceAllViaReger
pxReplaceAllViaRegex(Param.ContentMessage, "[?, *, <, >, |, : ]", " ")
Param variable which is mentioned in the function contains the string with special characters.I have instructed function to replace the special characters.So, output of the funtion will be the string without special characters
For pxContainsViaRegex
@pxContainsViaRegex(.pyRuleSetVersion, "[0-9][0-9]\\-[0-9][0-9]\\-[0-9][0-9]", false)
funtion will check whether the attribute pyRuleSetVersion contains the pattern.Depends on match or unmatch you will get boolean output.
Booz Allen Hamilton
US
Hi
Thanks for the quick reply. I am trying to use @pxContainsViaRegex(Param.PropertyName, "[?,.*<>\/|:]",true)
Then above is used to check if the Property has any of the Characters, then return a value true. But i am getting error for using the special characters. Is the expression correct.
Thank you
Nalina. R
AI4Process Ltd
GB
Need to add excape character '\' to'\', like pxContainsViaRegex(Param.PropertyName, "[?,.*<>\\/|:]",true)
-
Silpa Karunakaran Sowmya Akula ABDUL RAHEEM
Pegasystems Inc.
IN
fyi - to test regEx: please refer to Code-Pega-Parse.RegExpTester or http://www.regexpal.com/
Vijetha Mulky Kamath
US
My requirement is like Return Value has A & B .Can i use the expression here?