All pastes #406266 Raw Edit

Something

public text v1 · immutable
·published 2007-03-22 08:38 UTC
rendered paste body
06:18:42 -!- thinkmassive [n=alex@c-24-127-38-216.hsd1.va.comcast.net] has joined #regex
06:20:54 < thinkmassive> how do I match the beginning of a line in a multiline document using grep?
06:21:42 < thinkmassive> I've tried "^[(^apple)|(^orange)]" but it matches anywhere in the line
06:22:37 < thinkmassive> and grep doesn't understand \n I don't think
06:22:58 < thinkmassive> this must be a common problem but I don't see it anywhere google sent me
06:26:26 -!- thinkmassive [n=alex@c-24-127-38-216.hsd1.va.comcast.net] has left #regex []
06:30:56 < prec> [] matches a single character
06:31:29 < prec> grep understands neither () nor |  use egrep for alternation support (or grep -E)
06:31:48 < prec> egrep '^apple|^orange'
06:31:55 < prec> egrep '^(apple|orange)'
06:32:18 < prec> prec: he left already dude.
06:32:31 < prec> prec: OK, I'll stop talking to myself then, thanks.
06:47:48 -!- thinkmassive [n=alex@pool-70-110-6-85.roa.east.verizon.net] has joined #regex