I would like to match attribute pairs from string similiar to the one below
<tag_name attra="#{t("a.b.c")}" attrb="aa a">
… sould match on
attra=”#{t(“a.b.c”)}”
and
attrb=”aa a”
thanks in advance
Marius
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could use lookaheads to detect if the quotes that are ending are part of the value or not, by looking if they are followed by a space or ‘>’
Of course that won’t work if you have a quote followed by a space or a ‘>’ in your attribute value, so no matter how you look at it its a losing battle unless you skip those quotes inside the attribute values or preprocess them somehow. That’s the reason why every language’s string and regex have delimiters be skipped or preprocessed if they’re found inside of the delimited value.