I have been trying to get text between two strings-('Item' and 'Item') but since 'Item' is present multiple times throughout the large document(which is itself a string) i get almost all whole of the document. I can't figure out the regex code to get text between one 'item' and the next 'Item' till the last 'Item' as different strings.
I have tried regex codes but i can't figure it out.
First try :
(?<=Item)(.*)(?=Item)
Second try:
value = search('Item(.+)Item', text)
if value is not None:
value = value.group(1)
The First try selects almost all of document
The Second try only gives the first occurrence of text between 'Item' and 'Item'.
Any help would be greatly appreciated.
Item(.*?)Item