1

Lets say we have this string:"Code:1,Some text some other text {fdf: more text, attr=important "

I want to catch the pattern using Regex that can findall attr and extract important and 1 and put them in dict.

I tried this one:

(?<=testcaseid_)[^_]+_[^_]+

but still capture all the previous

1 Answer 1

1

I'm not sure if I understand well, but if you want to get everything starts from "1" to something after attr= you can also use regex like this:

r"1.*?attr=\w+"
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.