0

I have this expression to match in order to find the right file

(123456A)(.*?)(?:\\")' 'parts'}}{{parts.0}}{{parts.1}}

It does not match with 123456A000000022

4
  • The first capture group is missing 0 Commented Aug 30, 2021 at 19:04
  • (123456A).0*2* isn't this works with your provided string, also (.*?) this will stop to see the further stuff in your regex. Commented Aug 30, 2021 at 19:17
  • Try any site like regexr.com to help you build the regex you want. Commented Aug 30, 2021 at 19:21
  • Can you add to the question how you are using that in code? If that by itself is a regex, it does not match the example string as there are no curly brackets or parts Commented Aug 30, 2021 at 20:17

1 Answer 1

1

I suspect that the HTML nature of posting here has hidden some of your potential match string from us, but it clearly won't match.

This is a great tool for building complex regex strings and testing them: https://regex101.com/

From what I see, the non-capturing group requires the string to have a backslash, so the match fails right there. I don't understand the rest of what you were intending with your match string, because there are mismatched quotes and braces. Again, I suspect I'm not seeing what you actually intended.

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

Comments

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.