From: Henrik Nyh Date: 2008-10-18T17:23:10+09:00 Subject: Re: Shoes GUI - downloading site, using reg exs on body On Sat, Oct 18, 2008 at 1:33 AM, Double Minus wrote: > I was starting with a very basic search, to > just try to have it pull out every line with "http" in it. > > (/^*http\/$/) doesn't work for my reg ex > > I get: > > rb:23: invalid regular expression; there's no previous pattern, to which > '*' would define cardinality at 2: /^*http\/$/ See if you can find a good guide to regular expressions -- they're very useful once you learn them. Your regexp is invalid because "*" in regexps does not mean "any characters, or no characters", it means "any, or none, of the preceding character or group". So ".*" (any or none of any character) is probably what you intended. You forgot the ":" between "http" and "/" though, if you intended to match "http:/". If you're doing real simple HTML munching, regexps can be fine, but look into Hpricot (http://code.whytheluckystiff.net/hpricot/).