title: iterating with regex over a text
body: <p>i have the following raw text:</p>
  <pre><code>acl number 3049 name SCAN-49-OUT
   description Scanner VLAN 49 ACL Outbound
   hardware-count enable
   step 10
   rule 0 permit ip destination 192.168.49.21 0
   rule 65530 permit ip destination 224.0.0.18 0
   rule 65534 deny ip
  acl number 3050 name condur-out
   step 10
   rule 0 permit tcp source 28.1.122.12 0 destination 28.1.114.12 0 destination-port eq 9001
   rule 10 permit tcp established destination 28.1.114.12 0
   rule 30 permit tcp established destination 28.1.115.128 0
   rule 40 permit tcp source 28.1.119.128 0 destination 28.1.114.12 0 destination-port eq 9000
   rule 60 permit tcp source 192.85.168.22 0 destination 28.1.114.12 0 destination-port eq 22
   rule 80 permit tcp source 192.85.168.22 0 destination 28.1.114.12 0 destination-port eq 9443
   rule 90 permit tcp source 28.1.115.128 0 destination 28.1.114.12 0 destination-port eq 9000
   rule 100 permit tcp source 192.85.168.22 0 destination 28.1.115.128 0 destination-port eq 443
   rule 65534 deny ip
  acl number 3051 name tom-out
   step 10
   rule 50 permit tcp source 28.1.112.0 0.0.0.255 destination 28.1.113.0 0.0.0.127 destination-port eq 1556
   rule 60 permit tcp source 28.1.112.0 0.0.0.255 destination 28.1.113.0 0.0.0.127 destination-port eq 13724
   rule 70 permit tcp source 28.1.112.0 0.0.0.255 destination 28.1.113.0 0.0.0.127 destination-port eq 13782
   rule 80 permit tcp source 28.1.112.0 0.0.0.255 destination 28.1.113.0 0.0.0.127 destination-port eq 10082
   rule 90 permit tcp source 28.1.112.0 0.0.0.255 destination 28.1.113.0 0.0.0.127 destination-port eq 10102
   rule 160 permit ip source 192.85.168.0 0.0.0.255 destination 28.1.113.0 0.0.0.127
   rule 5100 permit icmp icmp-type echo
   rule 5110 permit icmp icmp-type echo-reply
   rule 65500 permit tcp established destination 28.1.113.0 0.0.0.127
   rule 65534 deny ip
  acl number 3052 name jerry-out
   step 10
   rule 50 permit tcp source 28.1.113.0 0.0.0.127 destination 28.1.112.0 0.0.0.255 destination-port eq 1556
   rule 60 permit tcp source 28.1.113.0 0.0.0.127 destination 28.1.112.0 0.0.0.255 destination-port eq 13724
   rule 70 permit tcp source 28.1.113.0 0.0.0.127 destination 28.1.112.0 0.0.0.255 destination-port eq 13782
   rule 80 permit tcp source 28.1.113.0 0.0.0.127 destination 28.1.112.0 0.0.0.255 destination-port eq 10082
   rule 90 permit tcp source 28.1.113.0 0.0.0.127 destination 28.1.112.0 0.0.0.255 destination-port eq 10102
   rule 110 permit ip source 28.1.112.0 0.0.0.255 destination 28.1.112.0 0.0.0.255
   rule 120 permit tcp source 192.85.168.22 0 destination 28.1.112.0 0.0.0.255 destination-port eq 3389
   rule 130 permit udp source 192.85.168.22 0 destination 28.1.112.0 0.0.0.255 destination-port eq 3389
   rule 5100 permit icmp icmp-type echo
   rule 5110 permit icmp icmp-type echo-reply
   rule 10210 permit ip source 155.61.32.0 0.0.3.255 destination 28.1.112.0 0.0.0.255
   rule 10220 permit ip source 192.85.168.0 0.0.0.255 destination 28.1.112.0 0.0.0.255
   rule 65500 permit tcp established destination 28.1.112.0 0.0.0.255
   rule 65534 deny ip
  </code></pre>
  <p>i'm trying to iterate over the text above with the following regex pattern:</p>
  <pre><code>acl\snumber\s\d+\sname\s([a-zA-Z]+[a-zA-Z0-9_.+-]+)((\s\s)(description)?\s?(\s[a-zA-Z]+)\s([a-zA-Z]+)\s\d+\s([a-zA-Z]+)\s([a-zA-Z]+))?(\s\shardware-count\senable)?(\s\sstep\s\d+)?\s\srule\s\d+\s(permit|deny)\s[a-zAZ]+(\s(established))?(\ssource\s\d+.\d+.\d+.\d+\s\d+)?(\sdestination\s\d+.\d+.\d+.\d+\s\d+)?(\sdestination-port\seq\s\d+)?
  </code></pre>
  <p>but it only works for a few first lines
  and i would like to find a way to start from <code>acl number</code> till <code>rule 65534 deny ip</code></p>
  <p>i have tried a few lookahead and lookbehind but no luck....</p>
  <p>does anyone have any idea how could i make this happen?</p>