I have the following CSS code:
#np-toolbar-l a{ position: relative; padding: 0px 8px; line-height: 30px; display: inline-block; font-size: 12px; }
#np-toolbar-l a:hover{ background-color: #EFEFEF; opacity: 0.7; }
#np-toolbar-l a *:hover{ cursor: pointer; }
/** Icon */
#np-toolbar [class^="icon-"]{ font-size: 18px; vertical-align: middle; margin-right: 5px; }
I am trying to replace np-toolbar
to another ID,
I just want to match np-toolbar
not np-toolbar-l
or something like this,
here's a tutoral about how to capture all the IDs from CSS:
#-?[_a-zA-Z]+[_a-zA-Z0-9-]*(?=[^}]*\{)
source: Regex to match ids in a css file?
I couldn't find out how do I search a "compelete ID" by regex,
here's my example: (It'll still count np-toolbar-l
in)
/(?<=(#|\.))(np-toolbar)+(?=( |:||\[))/
EDIT: ummm, jsut added some symbols behind it,
it looks like the answer which I am looking for
/(?<=(#|\.))(np-toolbar)+(?=( |:|\[|\{|\.|,))/