*/
public ArrayList<String> extractLocalUrls()
throws ArrayIndexOutOfBoundsException {
ArrayList<String> aLocalUrls = new ArrayList<String>();
PatternMatcherInput oPinpt;
String sSrcUrl, sHrefUrl;
try {
synchronized(oCompiler) {
if (null==oFullHref) oFullHref = oCompiler.compile("<a( (accesskey|charset|class|coords|dir|hreflang|id|lang|name|rel|rev|shape|style|tabindex|target|title)\\s*=\\s*[\"']?([^'\"\\r\\n]+)[\"']?)* href\\s*=\\s*[\"']?([^'\"\\r\\n]+)[\"']?", Perl5Compiler.CASE_INSENSITIVE_MASK);
if (null==oGoodHref) oGoodHref = oCompiler.compile("<a( (accesskey|charset|class|coords|dir|hreflang|id|lang|name|rel|rev|shape|style|tabindex|target|title)\\s*=\\s*[\"']?([^'\"\\r\\n]+)[\"']?)* href\\s*=\\s*[\"']?(http://|https://|mailto:)\\w+([^'\"\\r\\n]+)[\"']?", Perl5Compiler.CASE_INSENSITIVE_MASK);
if (null==oHostHref) oHostHref = oCompiler.compile("<a( (accesskey|charset|class|coords|dir|hreflang|id|lang|name|rel|rev|shape|style|tabindex|target|title)\\s*=\\s*[\"']?([^'\"\\r\\n]+)[\"']?)* href\\s*=\\s*[\"']?(http://|https://)localhost([^'\"\\r\\n]+)[\"']?", Perl5Compiler.CASE_INSENSITIVE_MASK);
if (null==oFullSrc) oFullSrc = oCompiler.compile("<img( (align|alt|border|class|dir|height|hspace|id|ismap|lang|longdesc|style|title|usemap|vspace|width)\\s*=\\s*[\"']?([^'\"\\r\\n]+)[\"']?)* src\\s*=\\s*[\"']?([^'\"\\r\\n]+)[\"']?", Perl5Compiler.CASE_INSENSITIVE_MASK);
if (null==oGoodSrc) oGoodSrc = oCompiler.compile("<img( (align|alt|border|class|dir|height|hspace|id|ismap|lang|longdesc|style|title|usemap|vspace|width)\\s*=\\s*[\"']?([^'\"\\r\\n]+)[\"']?)* src\\s*=\\s*[\"']?(cid:|http://|https://)([^'\"\\r\\n]+)[\"']?", Perl5Compiler.CASE_INSENSITIVE_MASK);
if (null==oHostSrc) oHostSrc = oCompiler.compile("<img( (align|alt|border|class|dir|height|hspace|id|ismap|lang|longdesc|style|title|usemap|vspace|width)\\s*=\\s*[\"']?([^'\"\\r\\n]+)[\"']?)* src\\s*=\\s*[\"']?(http://localhost|https://localhost)([^'\"\\r\\n]+)[\"']?", Perl5Compiler.CASE_INSENSITIVE_MASK);
}
oPinpt = new PatternMatcherInput(sBody);
while (oMatcher.contains(oPinpt, oFullSrc)) {
sSrcUrl = oMatcher.getMatch().toString();
if (!oMatcher.matches(sSrcUrl, oGoodSrc))
aLocalUrls.add(sSrcUrl);
if (oPinpt.endOfInput()) break;
} // wend
oPinpt.setCurrentOffset(oPinpt.getBeginOffset());
while (oMatcher.contains(oPinpt, oFullSrc)) {
sSrcUrl = oMatcher.getMatch().toString();
if (oMatcher.matches(sSrcUrl, oHostSrc))
aLocalUrls.add(sSrcUrl);
if (oPinpt.endOfInput()) break;
} // wend
oPinpt.setCurrentOffset(oPinpt.getBeginOffset());
while (oMatcher.contains(oPinpt, oFullHref)) {
sHrefUrl = oMatcher.getMatch().toString();
if (!oMatcher.matches(sHrefUrl, oGoodHref))
aLocalUrls.add(sHrefUrl);
if (oPinpt.endOfInput()) break;
} // wend
oPinpt.setCurrentOffset(oPinpt.getBeginOffset());
while (oMatcher.contains(oPinpt, oFullHref)) {
sHrefUrl = oMatcher.getMatch().toString();
if (oMatcher.matches(sHrefUrl, oHostHref))
aLocalUrls.add(sHrefUrl);
if (oPinpt.endOfInput()) break;
} // wend
} catch (MalformedPatternException neverthrown) { }
return aLocalUrls;
} // extractLocalUrls