I want to remove anything between <
and >
including (<
and >
) from my string with regular expression. Here are few examples.
Hi<friends>and<family>
it should give Hiand
<Rekha Verma>[email protected]
then it should give [email protected]
Reva Patel
it should give Reva Patel
<Reva Patel>[email protected],<rekha Verma>[email protected]
it should give
[email protected],[email protected]
Can anyone please give me a regular expression for this? I need to implement it in Java.
Extract part string between two different characters with formulas. To extract part string between two different characters, you can do as this: Select a cell which you will place the result, type this formula =MID(LEFT(A1,FIND(">",A1)-1),FIND("<",A1)+1,LEN(A1)), and press Enter key.
Try using the regex:
<.*?>
For example:
String s = "Hi<friends>and<family>";
System.out.println(s.replaceAll("<.*?>", ""));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With