I'm trying to use regex to match an id containing an unpredictable number in the middle of an otherwise predictable string, an example:
<div id="type-84289-model" class="vehicle">
I've tried various things, but it seems like the most obvious that should work is:
By.xpath("//div[matches(@id, 'type-.+-model')]"));
However that doesn't find the element. Can anyone point me in the right direction.
[starts-with(@id, 'type-') and ends-with(@id, '-model')].