alexandros12
Programmer
- Oct 12, 2003
- 4
Hi there ! I want to make a regular expression in order to get the attributes from a html tag.
re.Pattern = "\s+(\w+)=""([^""]+)"""
the above is working almost well but it gets all strings that are like this ' aaa="bbb" ccc="ddd"'
now i want only to get these strings
'<aaa bbb="ccc" ddd="eee"'
i mean with a < in front of them.
i tried to do this :
"<\w+\s+(\w+)=""([^""]+)"""
the problem is it only gets the first attribute of the tag and misses
all the next ones.
Is there a way to get all attributes ?
Do you know where else should i ask this question ?
Thanks!
re.Pattern = "\s+(\w+)=""([^""]+)"""
the above is working almost well but it gets all strings that are like this ' aaa="bbb" ccc="ddd"'
now i want only to get these strings
'<aaa bbb="ccc" ddd="eee"'
i mean with a < in front of them.
i tried to do this :
"<\w+\s+(\w+)=""([^""]+)"""
the problem is it only gets the first attribute of the tag and misses
all the next ones.
Is there a way to get all attributes ?
Do you know where else should i ask this question ?
Thanks!