From: Mark Thomas Date: 2009-02-12T12:23:45+09:00 Subject: Re: regexp problem On Feb 11, 5:29 pm, w_a_x_...@yahoo.com wrote: > I'd rather use Ruby. Would you use Ruby string functions instead of the regular expression? You could, but you probably wouldn't want to. XPath is like regular expressions for XML and HTML. It has a particular syntax but once you learn it, it's very powerful. > // is quite cryptic. It's the wildcard in XPath. So '//td' just means the td can be anywhere in the tree, as opposed to '/td' which would be at the root. It's no more cryptic than the .* wildcard in regexps. td[contains(.,"Traffic Left")] The square braces constrain the td with an expression that compares the current td node (that's what the . means) to the string "Traffic Left". So this phrase says select the tag(s) which contain the string. following-sibling::td//script This says find the