Using regular expressions to match a CSS class 13/08/2012
# The following will match for a part of the CSS class(es) of a DIV element and 
# returns the element
browser.div(:class => /active/)

# The following checks if a DIV with a class of active exists
browser.div(:class => /active/).exists?

Matching a partial CSS class or one of several CSS classes can be done using the regular expression operator as shown above.