Error running child : java.lang.StackOverflowError
这是regex Pattern.compile("<title>(.+)</title>");
跑small wiki的时候完全正常,wiki的时候180个map有一个map跪在stack overflow上了
--
You received this message because you are subscribed to the Google Groups "cs402pku" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cs402pku+u...@googlegroups.com.
To post to this group, send email to cs40...@googlegroups.com.
Visit this group at http://groups.google.com/group/cs402pku.
For more options, visit https://groups.google.com/d/optout.
有可能是贪婪模式引起了太多次回溯,可以试试懒惰模式:Pattern.compile("<title>(.+?)</title>");。
贪婪模式和懒惰模式的区别可以百度“java 正则表达式 greedy”,http://blog.csdn.net/lovingprince/article/details/8813501。
一般来说,对于表示字符集合的“.”和“[^a]”之类,应避够在其上使用贪婪型重复运算符* + ?,而应使用懒惰的*? +? ??。