How do I use regular expressions in between the CSS Selenium Selector code? How do I use regular expressions in between the CSS Selenium Selector code? selenium selenium

How do I use regular expressions in between the CSS Selenium Selector code?


CSS doesn't support regular expressions in general, but if you just want to wildcard the entire middle part out of your ID, that's actually quite doable in CSS, as shown in this answer.

Given your code, you can use:

selenium.click("css=span[id^='mainId'][id$='radiospan1e']");