How to check an input string for special characters
Hi,
I am new to Objectscript so need some help please.
How would I check a string for special characters as per below?
/^[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]*$/
Thanks so much,
Product version: IRIS 2022.1
you can use $zstrip, where action *P, * is for any place, and P any punctuation
for example
And if you just want to check if the string contains any punctuations, you can compare if the original string does not equal the same after $zstrip.
if you wish to use regexp, you can use $match
Thanks so much Dmitry - thats perfect. Really appreciate the help.
Have a great day :)
You can use Objectscript pattern matching:
Set String="a=b"
Write String?.e1P.e => 1
The case isn't important, just to highlight the 1P(unctuation)