tags:

views:

30

answers:

1

I have the following Haml code:

%ul#sub-nav
      %li.li1
        %a{:href => "/dsadasd/"} dasdasd
      %li.li2
        %a.selected{:href => "/asdadasd"} Tasdada /asdas
      %li.li3
        %a{:href => "/dasd/"} asdasd
      %li.li4
        %a{:href => "/wdasn/"} das

I seem to be able to match this with the following repetitive regex - %ul#sub-nav\n.*\n^.*\n^.*\n^.*\n^.*\n^.*\n^.*\n^.* in intellij's rubymine ide.

This looks way too repetitive. Help appreciated.

+1  A: 

If you want to match %ul#sub-nav plus the eight following lines, this should do:

%ul#sub-nav(\n.*$){8}
Tim Pietzcker
Awesome - just what I needed thanks
Dr. Frankenstein