Then I should see text matching "text pattern" in the "element" element

Assert that an element's text content does or does not match a regex.

Step pattern

Then (I |we )*should( not)* see text matching "([^"]*)?" in( the)* "([^"]*)?" element

Examples

Example #1
Then I should see text matching "\d{4}" in the "#year" element
Example #2
Then I should see text matching "\$\d+\.\d{2}" in the "#price" element
Example #3
Then I should not see text matching "Error" in the "#status" element
Example #4
Then we should see text matching "^[A-Z][a-z]+ [A-Z][a-z]+$" in the "#full-name" element
Example #5
Then I should see text matching "(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}" in the "#date" element