Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

SRP_Regex crash with invalid pattern

Hi,

I noticed an issue with SRP_Regex, where if an invalid pattern is passed in, OI crashes.

Our SRPUtilites DLL version is 2.2.15.3

Examples

✅ This works


goodEmailPattern = '.*@mydomain\.com$'
isOurEmail = SRP_Regex('Match', 'angelo.melo@mydomain.com', emailPattern)

😢 This kills OI


badEmailPattern = '*@mydomain\.com$'
isOurEmail = SRP_Regex('Match', 'angelo.melo@mydomain.com', emailPattern)
The difference is the missing “.” (period) before the “@” sign, which makes the pattern invalid.
In regex101.com that pattern raises the error

* The preceding token is not quantifiable
It would be helpful if SRP_Regex returned a similar error message instead of crashing the runtime.

Thank you
Sign In or Register to comment.