C#C
C#2y ago
Quark

✅ Regex to capture all attributes of html tag but it capture the last only.

Hi,

i have this code (see the picture)

i don't understand why i have the last attribute only.

i need have all.
please, help me.

code to use:
 MatchCollection attrmatches = new Regex(@"<[a-zA-Z.]+(?:\s+(\w+)\s*=\s*""[^""]*"")*\s*>", RegexOptions.Compiled).Matches(line);



thx
Capture_decran_2024-02-12_115820.png
Was this page helpful?