9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] plan 9 regexp
@ 2009-06-03 14:56 hugo rivera
  2009-06-03 16:21 ` Rodolfo (kix)
                   ` (5 more replies)
  0 siblings, 6 replies; 30+ messages in thread
From: hugo rivera @ 2009-06-03 14:56 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hello,
I am experimenting with some regexp implementations (namely the one
from "the practice of programming") and I am a little disoriented by
the use of the '?' operator in plan 9's grep:
say I have the following input

aaaabbb
ab
aaaab
bb
b
aaabb
aaaa

which I feed into grep with

grep 'a+bb?'

which should match at least one 'a' followed by one or two 'b'. So,
grep's output is

aaaabbb
ab
aaaab
aaabb

which really surprised me at first, since I wasn't expecting the first
line. After some thought, I realized that the 'aaaab' and the 'aaaabb'
patterns, contained in the first line of input, match the regexp, so
grep prints the line.
But then, how exactly the '?' operator is useful for grep? I was
thinking that it was good to filter lines that contain more characters
that desired, but it is not.
Saludos
--
Hugo



^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: [9fans] plan 9 regexp
@ 2009-06-03 23:41 Francisco J Ballesteros
  2009-06-03 23:56 ` erik quanstrom
  0 siblings, 1 reply; 30+ messages in thread
From: Francisco J Ballesteros @ 2009-06-03 23:41 UTC (permalink / raw)
  To: 9fans

I have a ssam script that does the work. But  it's not really streaming.

El 04/06/2009, a las 1:36, jrm8005@gmail.com escribió:

> Speaking of regexes in Plan 9, did the "structural awk" or "stream
> sam" Rob dreamed of in the SE paper ever get realized?
>
> [/mail/box/nemo/msgs/200906/41493]



^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2009-06-13 18:29 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-03 14:56 [9fans] plan 9 regexp hugo rivera
2009-06-03 16:21 ` Rodolfo (kix)
2009-06-03 17:34   ` erik quanstrom
2009-06-03 17:46     ` Rob Pike
2009-06-03 18:05       ` hugo rivera
2009-06-03 16:50 ` yy
2009-06-03 16:51 ` Russ Cox
2009-06-03 17:19 ` Enrique Soriano
2009-06-03 20:01 ` Wu JIANG
2009-06-03 20:05   ` Wu JIANG
2009-06-03 20:11   ` hugo rivera
2009-06-03 20:44     ` Wu JIANG
2009-06-03 20:49       ` hugo rivera
2009-06-03 23:32 ` J.R. Mauro
2009-06-03 23:41 Francisco J Ballesteros
2009-06-03 23:56 ` erik quanstrom
2009-06-04  1:22   ` J.R. Mauro
2009-06-04 11:43     ` Martin Neubauer
2009-06-04 19:23       ` J. R. Mauro
2009-06-04 19:27         ` erik quanstrom
2009-06-04 21:54           ` J.R. Mauro
2009-06-05 18:12             ` erik quanstrom
2009-06-13 18:29           ` J.R. Mauro
2009-06-04 21:35   ` Dan Cross
2009-06-04 22:36     ` Charles Forsyth
2009-06-05  0:05       ` Dan Cross
2009-06-06 17:55         ` Ori Bernstein
2009-06-07 17:11           ` erik quanstrom
2009-06-07 21:31         ` Russ Cox
2009-06-05  0:07     ` Dan Cross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).