I'm trying to develop a regular expression for matching fixed characters. Below is the example:
String test = "<P>This is test. <A HREF="www.google.com">Google</A></P><P>Again this is a test. <A HREF="www.facebook.com">Facebook</A></P>";
I want to replace the block, having content starting with <A HREF=
and ending with >
, with the empty space. Can anyone tell me the regex for the same?
Output should be: <P>This is test. Google</A></P><P>Again this is a test. Facebook</A></P>
Edit: Some people are trying to relate this question to the one which specifies about regex and XHTML parsing. Well, I'm trying to match a block of characters in a java. So it clearly has not any relation with the XHTML parsing.