StringTokenizer st = new StringTokenizer(remaining, "\t\n\r\"'>#");
String strLink = st.nextToken();
The input to string remaining can be one of the following :
"http://somegreatsite.com">Link Name</a>is a link to another nifty site<H1>This is a Header</H1><H2>This is a Medium Header</H2>Send me mail at <a href="mailto:support@yourcompany.com">support@yourcompany.com</a>.<P> This is a new paragraph!<P> <B>This is a new paragraph!</B><BR> <B><I>This is a new sentence without a paragraph break, in bold italics.</I></B><HR></BODY></HTML>
"mailto:support@yourcompany.com">support@yourcompany.com</a>.<P> This is a new paragraph!<P> <B>This is a new paragraph!</B><BR> <B><I>This is a new sentence without a paragraph break, in bold italics.</I></B><HR></BODY></HTML>
I know that the StringTokenizer
constructor will split the string *remaining*
into tokens using the regular expression.
But I unable to understand the regular expression used here.
The strLink
will have the following value based upon the value in the string *remaining*
:
1.http://somegreatsite.com
2.mailto:support@yourcompany.com
Please help me in understanding the regular expression used in the code above.