I have a string string = "radios label="Does the command/question above meet the Rules to the left?" name="tq_utt_test" validates="required" gold="true" aggregation="agg""
and I want to be able to extract the substring within the "name
". So in this case I want to extract "tq_utt_test
" because it is the substring inside name
.
I've tried regex re.findall('name=(.*)\s', string)
which I thought would extract everything after the substring name=
and before the first space. But after running that regex, it actually returned "tq_utt_test" validates="required" gold="true"
. So seems like it's returning everything between name=
and the last space, instead of everything between name=
and first space.
Is there a way to twist this regex so that it returns everything after name=
and before the first space?