Reputation: 15
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
Upvotes: 1
Views: 92
Reputation: 26
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+"
Upvotes: 1