9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] plumber rule for WikiWords
@ 2008-01-13 18:04 Matthias Teege
  2008-01-13 18:19 ` erik quanstrom
  0 siblings, 1 reply; 4+ messages in thread
From: Matthias Teege @ 2008-01-13 18:04 UTC (permalink / raw)
  To: 9fans

Moin,

I use the following plumbing rule to "emulate" wiki like functions in 
acme:

type is text
data matches '([A-Z]+[a-z]+[A-Z]+[a-z]+)*$'
data set wiki/$0.txt
plumb to edit

Most of the time it works but if I use a LongWikiWord it opens
WikiWord.txt instead of LongWikiWord.txt. It depends on where I click
on the word. If I click on Long nothing happens and if I click on Wiki
it opens WikiWord.

Is this a problem of the rule or a "feature"? I use acme  from Plan 9 
ports.

Many thanks
Matthias


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

* Re: [9fans] plumber rule for WikiWords
  2008-01-13 18:04 [9fans] plumber rule for WikiWords Matthias Teege
@ 2008-01-13 18:19 ` erik quanstrom
  2008-01-14  2:12   ` Yaroslav
  0 siblings, 1 reply; 4+ messages in thread
From: erik quanstrom @ 2008-01-13 18:19 UTC (permalink / raw)
  To: 9fans

> I use the following plumbing rule to "emulate" wiki like functions in 
> acme:
> 
> type is text
> data matches '([A-Z]+[a-z]+[A-Z]+[a-z]+)*$'
> data set wiki/$0.txt
> plumb to edit
> 
> Most of the time it works but if I use a LongWikiWord it opens
> WikiWord.txt instead of LongWikiWord.txt. It depends on where I click
> on the word. If I click on Long nothing happens and if I click on Wiki
> it opens WikiWord.
> 
> Is this a problem of the rule or a "feature"? I use acme  from Plan 9 
> ports.

i don't think your rule matches LongWikiWord because the rule
will only match words with an even number of studly caps.

assuming that you want >= 2 studly caps, i think the rule
you'd rather is

data matches '[A-Z]+[a-z]+([A-Z]+[a-z]+)+'

- erik


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

* Re: [9fans] plumber rule for WikiWords
  2008-01-13 18:19 ` erik quanstrom
@ 2008-01-14  2:12   ` Yaroslav
  2008-01-14  2:19     ` erik quanstrom
  0 siblings, 1 reply; 4+ messages in thread
From: Yaroslav @ 2008-01-14  2:12 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Not sure is it is suported in Acme, but...

([A-Z]+[a-z]+){2,}

-- 
Best regards,
    Yaroslav.


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

* Re: [9fans] plumber rule for WikiWords
  2008-01-14  2:12   ` Yaroslav
@ 2008-01-14  2:19     ` erik quanstrom
  0 siblings, 0 replies; 4+ messages in thread
From: erik quanstrom @ 2008-01-14  2:19 UTC (permalink / raw)
  To: 9fans

> Not sure is it is suported in Acme, but...
> 
> ([A-Z]+[a-z]+){2,}
> 
> -- 
> Best regards,
>     Yaroslav.

acme isn't evaluating the match, plumber is.  plan 9
regular expressions (ether way) do not support {} ranges.

- erik


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

end of thread, other threads:[~2008-01-14  2:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-13 18:04 [9fans] plumber rule for WikiWords Matthias Teege
2008-01-13 18:19 ` erik quanstrom
2008-01-14  2:12   ` Yaroslav
2008-01-14  2:19     ` erik quanstrom

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).