Reputation: 1053
I have a text in which 3 kind of words are repeating:
class="text"
style="line-height:13.5pt">
{font-family:
I want a regex to match these "words", which may contain characters like "
>
:
=
-
{
}
as well as the standard "word characters" that can be matched using\w
.
I made a regex:
(\w)+(?=\w*[a-z])(?=\w+[\{+\=+\"+\}+\:])\w+
but doesn't work.
Upvotes: 0
Views: 667
Reputation: 424993
Use a character class that includes both traditional word chars and your extra ones:
[\w">:={}-]+
Note that you don't need to escape those chars inside a character class. This even includes the hyphen when it's first or last.
Upvotes: 1