Sorry, I had answered Tim and forgot to put the list in copy.<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Raphaël Pinson</b> <span dir="ltr"><<a href="mailto:raphink@gmail.com">raphink@gmail.com</a>></span><br>
Date: 2009/12/29<br>Subject: Re: [augeas-devel] case-like solution?<br>To: Tim Stoop <<a href="mailto:tim.stoop@gmail.com">tim.stoop@gmail.com</a>><br><br><br><br><br><div class="gmail_quote"><div class="im">On Tue, Dec 29, 2009 at 4:15 PM, Tim Stoop <span dir="ltr"><<a href="mailto:tim.stoop@gmail.com" target="_blank">tim.stoop@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
<br>
I'm trying my hand at writing a lens that would allow me the create<br>
mod_rewrite rules (including conditions) in a file. I'm having a<br>
little trouble defining the following:<br>
<br>
If the RewriteCond line ends in "[OR]", I need the "chain_as" item to<br>
have the value "or", but if there's nothing at the end of the line, I<br>
want the chain_as value to be defined as "and". Any hints on how to do<br>
this?<br>
<br>
It's but a first attempt, but once I have it working more or less,<br>
I'll post it here, of course. Not sure if anyone else could use such a<br>
specific lens.<br>
<font color="#888888"><br></font></blockquote><div><br></div><div><br></div></div><div>Something like this (not tested):</div><div><br></div><div><br></div><div>   let chain_as = [ </div><div>           label "chain_as"</div>

<div>              . ( value "or" . del "[OR]" "[OR]" ) | ( value "and" )</div><div>       ]</div><div>   </div><div>   let line = whatever . chain_as . eol</div><div><br></div><div>

<br></div><div><br></div><div>Raphaël</div><div><br></div><div><br></div><div><br></div></div>
</div><br>