summaryrefslogtreecommitdiff
path: root/bs4/element.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2015-06-24 07:17:14 -0400
committerLeonard Richardson <leonardr@segfault.org>2015-06-24 07:17:14 -0400
commit8fb4389df679d38add64014f5a1b71d6d4820e1f (patch)
tree7cabf40c2e5600014bfb8185d244ae2d96d07d42 /bs4/element.py
parent8b63da202f6d1c55f41f4011e686938eee7e4cee (diff)
The select() method can now find tags with attributes whose names
contain dashes. Patch by Marek Kapolka. [bug=1304007]
Diffstat (limited to 'bs4/element.py')
-rw-r--r--bs4/element.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bs4/element.py b/bs4/element.py
index 0c2e11a..5d895ab 100644
--- a/bs4/element.py
+++ b/bs4/element.py
@@ -570,7 +570,7 @@ class PageElement(object):
# | Attribute
# Tag
attribselect_re = re.compile(
- r'^(?P<tag>[a-zA-Z0-9][-.a-zA-Z0-9:_]*)?\[(?P<attribute>\w+)(?P<operator>[=~\|\^\$\*]?)' +
+ r'^(?P<tag>[a-zA-Z0-9][-.a-zA-Z0-9:_]*)?\[(?P<attribute>[\w-]+)(?P<operator>[=~\|\^\$\*]?)' +
r'=?"?(?P<value>[^\]"]*)"?\]$'
)