I have the following strings
s1 = 'XXX-2 I LOVE : XXX XXX'
s2 = 'FOOD : XXX'
s3 = 'XXX-FOOD : XXX
I would like the following
s1 = '2 I LOVE'
s2 = 'FOOD'
s3 = 'FOOD'
s2 only has 1 delimiter : while s1 & s3 have 2 - & :
I would like to keep everything between the two delimiters - & : so I use the following \-(.*?)\: however I don't get s2
If I use the following \w+\-?(.*?)\: I get everything before -
I am terrible at regex, if someone could help me with this one and provide a link to understanding regex I would really appreciate it.
s2doesn't have two delimiters to use?