On Mon, Jul 07, 2003 at 07:55:52AM +0900, Jim Freeze wrote:
> I am looking for a regex that will match a line with a single
> carrot:

(fwiw, that's 'caret' :)

> Does anyone know how to match '^' at the beginning of a line?

irb(main):009:0> "^foo\n" =~ /^[\^]/
=> 0
irb(main):010:0> "foo\n" =~ /^[\^]/
=> nil

irb(main):012:0> "^\n" =~ /^[\^]$/
=> 0
irb(main):013:0> "^ \n" =~ /^[\^]$/
=> nil

HTH :)

-- 
01CB B175 70D8 2E39 CA13  AEA6 3A2B 2219 31CD 5381