I have a generated HTML page where I expect string “A” to appear before String “B” on the page. (Note that A and B can be in different lines on the Page with arbitrary strings / characters in between.
I am trying to create a regular expression that checks for this criteria.
Here is what I have
regexp = Regexp.new ".*#{S1}.*#{s2}"
match = page.body ~= regexp
where S1 and S2 are strings “A” and “B” respectively.
after executing this on a page with A appearing before B match still returns nil.
Try:
Edit (by Dennis Mathews, 2012-03-16): The first .* was not required .. so the working code is