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
The difference is the missing “.” (period) before the “@” sign, which makes the pattern invalid.
badEmailPattern = '*@mydomain\.com$'
isOurEmail = SRP_Regex('Match', 'angelo.melo@mydomain.com', emailPattern)
In regex101.com that pattern raises the error
It would be helpful if SRP_Regex returned a similar error message instead of crashing the runtime.
* The preceding token is not quantifiable
Thank you
