I need to regex string myString to only have:
This is my code line:
new Regex("[a-zA-Z0-9]").IsMatch(myString);
So far I have [a-zA-Z0-9] and this works fine for the first two listitems.
Currently tearing my hair out (and it's so nice I want to keep it) over metacharacters and getting nowhere.
Any help would be greatly appreciated. Thanks. Dave
Hi there If you want only the listed characters in your string it is very simple.but you need to match beginning an end of line
new Regex("^[a-zA-Z0-9'!#$%&'*+/=?^_`{|}~.-]*$").IsMatch(myString);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With