I am trying to form a regex that functions as mentioned below:
String killing of <span class="abc">cats</span>, hi <span class="xyz">dogs</span>,
Splits into :
1. killing
2. of
3. <span class="abc">cats</span>,
4. hi
5. <span class="xyz">dogs</span>,
This regex \\<.*?\\>| splits it but tags are stripped and , after tags is a new string.
Can’t help with a
split(), but here’s a solution with a sequentialfind():Output: