[rspec-users] regex help

Jonathan Linowes jonathan at parkerhill.com
Mon Dec 29 12:53:24 EST 2008


Thanks that worked.

Normally I would combine them into one step, but this case, one is in  
a general reusable steps file, and the other is specific to a  
feature. I thought the word "item" would be sufficient to distinguish  
the two.



On Dec 29, 2008, at 1:07 AM, Stephen Eley wrote:

> On Sun, Dec 28, 2008 at 11:59 PM, Jonathan Linowes
> <jonathan at parkerhill.com> wrote:
>>
>> Perhaps tell it to ignore any matches with " item" in it, but dont  
>> know how
>
> It's called a zero-width negative lookahead, and it looks like this:
> /^the (?!\w+ item)(.*) should have a \<(.*)\> tag with "(.*)"/
>
> I didn't test this to be sure, but I believe it should work.  But
> rephrasing your steps so that one isn't a special case of the other
> would probably be better.  Or just having one step that contains the
> logic from both.
>
>
> -- 
> Have Fun,
>    Steve Eley (sfeley at gmail.com)
>    ESCAPE POD - The Science Fiction Podcast Magazine
>    http://www.escapepod.org
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users



More information about the rspec-users mailing list