JITU99
(jitendra)
May 22, 2023, 4:15am
1
How can i check if my string contains Special Characters other than the following special characters.
curly brackets ( )
Square Brackets
Apsotrophe β
slash /
My String should return false if any special charaters are present other than the above(alphanumeric is accepted)
Can someone please help.
Hi @JITU99
You can use the following pattern for the same:
^[a-zA-Z0-9]*$
Hope this helps,
Best Regards.
JITU99
(jitendra)
May 22, 2023, 4:30am
3
Hi @arjunshenoy
My string should not contain special charaters other than mentioned here brackets (),square brackets ,slash / , apstrophe β
@JITU99
As you mentioned, the pattern holds good for all your requirements:
Best Regards.
Yoichi
(Yoichi)
May 22, 2023, 4:44am
5
Hi,
Can you try the following expression?
not System.Text.RegularExpressions.Regex.IsMatch(yourString,"[^A-Za-z0-9 ()\[\]'/]")
This allows to include whitespace.If you also need to check whotespace, can you try the following?
not System.Text.RegularExpressions.Regex.IsMatch(yourString,"[^A-Za-z0-9()\[\]'/]")
Regards,
JITU99
(jitendra)
May 22, 2023, 4:45am
6
I believe still my question is not clear to you. @arjunshenoy
My striong should contain special cahraters ( , ) , [ , ] , \ , β (apostrophe)
@JITU99
I think now itβs clear. Can you please try this pattern:
^[a-zA-Z0-9()\[\]/\\']*$
Best Regards.
1 Like
system
(system)
Closed
May 25, 2023, 4:53am
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.