Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
9 replies
Subscribers
5 subscribers
Views
7184 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Plug-Ins
Hi, I'm currently using Regular Expression Plugin to match the RegEx Pattern
deepanc712
over 8 years ago
Hi, I'm currently using Regular Expression Plugin to match the RegEx Pattern. I'm using regexmatch() function to validate the pattern 0-9]++) .
For which The function returns the exception of " Expression evaluation error at function 'regexmatch': Error evaluating function 'regexmatch' : Unmatched closing ')' near index 6 [0-9]++) ^ ".
I would like to validate the correctness of the pattern given. Could the Appian aspirants let me know is there any workaround function need to pre validate the input before we use the same with RegEx.
Thanks,
Deepan
OriginalPostID-162353
OriginalPostID-162353
Discussion posts and replies are publicly visible
0
Tim
Certified Lead Developer
over 8 years ago
Try using char(41) in your expression: ..."[0-9]++"&char(41)&...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
deepanc712
over 8 years ago
Thanks Tim. This is going to be user entered value which is anonymous and do we need to convert some specific ")" before we pass on to regexmatch() function..
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Jacob Cohen - Project Leader - Macedon Technologies
over 8 years ago
If you're looking to match the close paren character, you'll need to escape it first. I believe the escape character is '\\', so you would want to escape any regex characters before running them through the function.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 8 years ago
Check out this tool -
http://regexr.com/
- it allows you to validate and test regular expressions; just paste your expression in and it will tell you what's wrong. Once you've fixed the expression (jacob is correct with his diagnosis above, though i believe you also have too many "+" as well) then you can also paste in data to see what exactly will match.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
vikask146
over 8 years ago
It seems an issue with regexmatch function in Appian as it doesn't validate invalide regular expressions. [0-9]++ is an invalid expression but Appian accepts this and also provide results which should not be.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
vikask146
over 8 years ago
Please ignore my above message, it seems some online Regex website shows the above RegEx is invalid but JAVA takes this is Valid so Appian functions are ok but in this plugin, exceptions are not being handled.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 8 years ago
I disagree; the regexmatch function isn't there to validate regular expressions, merely to implement them. If the regex is invalid it should throw an error, which is exactly what it does.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
vikask146
over 8 years ago
Please look into attached doc and also see the same expression in the URL which you mentioned.
RegExJava.docx
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 8 years ago
In your example, the syntax is considered correct because the regex is contained within a string and so is not validated.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel