0

I want regex to combine

".*SimpleTaskv9MoreDetails.*"

or

".*SimpleTaskv10MoreDetails.*"

How can I create regex to match both of them? I know that below one matches v8 and v9

".*SimpleTaskv[89]MoreDetails.*"

But if I want both v9 and v10 to be accepted? How do I do it?

0

2 Answers 2

2

Use alternatives:

.*SimpleTaskv(?:9|10)MoreDetails.*
Sign up to request clarification or add additional context in comments.

Comments

0

If you want to generally match your existing pattern but with any non-zero-length sequence of digits in the middle, you could do this:

.*SimpleTaskv\d+MoreDetails.*

1 Comment

I want to match only for v9 or v10. Don't want to match with old versions

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.