0

I have a string which i need to parse using Regex class of System.Text.RegularExpressions. I need to find if the first 2 characters of the string are either "00" or "07" or "16" or "23". Please let me know as what the pattern would be to match the above.

0

1 Answer 1

3

You could do:

^(00|07|16|23).*

As seen on rubular

Sign up to request clarification or add additional context in comments.

1 Comment

thanks to all who viewed and of course to all those who helped me out especially "NullUserException". the following code did really work - "^(00|07|16|23).*"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.