Look at this:

```
set policy id 1508 from "TEST" to "OPR"  "10.2.197.3/32" "ARG-VCENTER-SRV-1" "ANY" permit

set policy id 1508

exit

set policy id 1507 from "CMS-SrvFarm" to "DMZ"  "CMS-SRV5(10.2.90.14)" "THR-CMS-SRV-0" "TCP-123" permit

set policy id 1507

set service "TCP-37"

exit

```

I want to set the whole lines before exit into the Python list which meaning :

```
    list=[
'set policy id 1508 from "TEST" to "OPR"  "10.2.197.3/32" "ARG-VCENTER-SRV-1" "ANY" permit\n\nset policy id 1508',
'set policy id 1507 from "CMS-SrvFarm" to "DMZ"  "CMS-SRV5(10.2.90.14)" "THR-CMS-SRV-0" "TCP-123" permit\n\nset policy id 1507\n\nset service "TCP-37"'
]

```

How can I do this using regex?

note that i want the whole codes before exit in one of the list indexes. i mean :

```
    list=[
'set policy id 1508 from "TEST" to "OPR"  "10.2.197.3/32" "ARG-VCENTER-SRV-1" "ANY" permit\n\nset policy id 1508',
'set policy id 1507 from "CMS-SrvFarm" to "DMZ"  "CMS-SRV5(10.2.90.14)" "THR-CMS-SRV-0" "TCP-123" permit\n\nset policy id 1507\n\nset service "TCP-37"'
]

```

not this :

```
list=[
'set policy id 1508 from "TEST" to "OPR"  "10.2.197.3/32" "ARG-VCENTER-SRV-1" "ANY" permit',
'set policy id 1508',
'set policy id 1507 from "CMS-SrvFarm" to "DMZ"  "CMS-SRV5(10.2.90.14)" "THR-CMS-SRV-0" "TCP-123" permit',
'set policy id 1507',
'set service "TCP-37"'
]

```

i want the

```
re.findall()

```

pattern for finding the string which is started by set and ended by exit.

tanks.