I have a string something similar to this.
str1=r'<st-button mode="positive" width="small" can-click="{loadConference}" id="meetingPasswordButton">{{i18n "ok"}}</st-button>'
I want to include everything between <
and >
and reject everything between </
and >
.
I tried this to include and reject the text between those special characters using following code. But I am unable to get the output. Help me cracking this situation.
code:
import re
pat = r'(?<=\<).+?(?=\>)' or r'(?<!\</).+?(?!\>)'
s = r'<st-button mode="positive" width="small" can-click="{loadConference}" id="meetingPasswordButton">{{i18n "ok"}}</st-button>'
print (re.findall(pat, s))