I want to use Cypress and a regular expression to select an element which contains a certain text.
This get() command works:
cy.get('[data-cy=tile]').contains(new RegExp(myVar))
But this command fails:
cy.get('[data-cy=tile]:contains(' + new RegExp(myVar) + ')')
Is there a way to use a regular expression within jQuery :contains()?