let say I have elements with title attribute like following
<div title="custom-marker-awlr-tailrace bbu-l2"></div>
<div title="custom-marker-aws-tailrace btut"></div>
<div title="custom-marker-arr-tailrace sbu-l3"></div>
<div title="custom-marker-wqs-tailrace bbu-l2"></div>
<div title="custom-marker-wqs-tailrace bbu-l1"></div>
how do I select div with title custom-marker-wqs-tailrace bbu-l2 using CSS regex selector?
something like div[title*="customer-marker-wqs...???"] I don’t know what should I write in place of ???
>Solution :
You may use a single attribute selector, e.g.
div[title="custom-marker-wqs-tailrace bbu-l2"] {
...
}
so you match the exact string or you could chain two attribute selectors, e.g.
div[title^="custom-marker-wqs-tailrace"][title$="bbu-l2"] {
...
}
by selecting a title starting (^=) with custom-marker-wqs-tailrace and ending ($=) with bbu-l2