StringTokenizer st = new StringTokenizer(remaining, "\t\n\r\"'>#");
String strLink = st.nextToken();
剩余字符串的输入可以是以下之一:
"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>
我知道构造函数会使用正则表达式StringTokenizer
将字符串拆分为标记。*remaining*
但我无法理解这里使用的正则表达式。
将strLink
根据字符串中的值具有以下值*remaining*
:
1. http://somegreatsite.com
2.mailto:support@yourcompany.com
请帮助我理解上面代码中使用的正则表达式。