user204488
user204488

Reputation: 23

how to write regex for below format using python

I want to validate below data using regex and python.
Below is the dump of the data which Can be stored in string variable

Start 0  .......... group=..... name=...... number=.... end=(digits)
Start 1  .......... group=..... name=...... number=.... end=(digits)
Start 2  .......... group=..... name=...... number=.... end=(digits)
Start 3  .......... group=..... name=...... number=.... end=(digits)

Where ......is some random data need not to validate
...
..

Start 100  .......... group=..... name=...... number=.... end=(digits)

Thanks in advance

Upvotes: 0

Views: 98

Answers (1)

Alex Martelli
Alex Martelli

Reputation: 881883

You could use r'(Start \d+.*?group=.*?name=.*?number=.*?end=\d+)*'.

Upvotes: 1

Related Questions