Try this
\b(?:font-weight\s*:[^;\{\}]*?\bbold)\b
or would be better to use:
\b(?:font-weight[\s*\\]*:[\s*\\]*?\bbold\b)
Explanation
\b # Assert position at a word boundary
(?: # Match the regular expression below
font-weight # Match the characters “font-weight” literally
[\s*\\] # Match a single character present in the list below
# A whitespace character (spaces, tabs, and line breaks)
# The character “*”
# A \ character
* # Between zero and unlimited times, as many times as possible, giving back as needed (greedy)
: # Match the character “:” literally
[\s*\\] # Match a single character present in the list below
# A whitespace character (spaces, tabs, and line breaks)
# The character “*”
# A \ character
*? # Between zero and unlimited times, as few times as possible, expanding as needed (lazy)
\b # Assert position at a word boundary
bold # Match the characters “bold” literally
\b # Assert position at a word boundary
)
Hope this helps.
var isBold = $(someSelector).css('font-weight') == 'bold'?$(someSelector).css('direction')seems to work for me...? It also works correctly with inheritance (e.g. the style is set on a parent of the element I'm inspecting)