diff --git a/HandsomeSoup.cabal b/HandsomeSoup.cabal
--- a/HandsomeSoup.cabal
+++ b/HandsomeSoup.cabal
@@ -7,7 +7,7 @@
 -- The package version. See the Haskell package versioning policy
 -- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for
 -- standards guiding when and how versions should be incremented.
-Version:             0.3
+Version:             0.3.1
 
 -- A short (one-line) description of the package.
 Synopsis:            Work with HTML more easily in HXT
diff --git a/Text/CSS/Parser.hs b/Text/CSS/Parser.hs
--- a/Text/CSS/Parser.hs
+++ b/Text/CSS/Parser.hs
@@ -58,7 +58,7 @@
 -- | selects attributes, like @ [id] @ (element must have id) or @ [id=foo] @ (element must have id foo).
 attributeSelector :: ParsecT [Char] u I.Identity ([Char], [Char])
 attributeSelector = do
-      _contents <- between (char '[') (char ']') (many1 (alphaNum <|> oneOf "|~=\"'"))
+      _contents <- between (char '[') (char ']') (many1 (alphaNum <|> oneOf "-_|~=\"'"))
       -- remove quotes
       let contents = filter (\c -> c /= '"' && c /= '\'') _contents
       if "~=" `isInfixOf` contents 
