jsoup解析html 在正则报的错,不知道什么错

达文西W 发布于 2017/03/13 11:26
阅读 300
收藏 0

我的正则是这个

String Regular = "<tr height=\"25\">([^>]*>){3}(?<StockCode>[^<]*)([^>]*>){3}(?<StockName>[^<]*)([^>]*>){6}(?<trade>[^<]*)([^>]*>){3}(?<UpToPrice>[^<]*)([^>]*>){2}(?<ZF>[^<]*)([^>]*>){2}(?<SZ>[^<]*)([^>]*>){2}(?<SYL>[^<]*)([^>]*>){2}(?<ZF3>[^<]*)([^>]*>){2}(?<ZF_halfyear>[^<]*)([^>]*>){2}(?<je>[^<]*)([^>]*>){2}(?<ddx>[^<]*)([^>]*>){2}(?<ddy>[^<]*)([^>]*>){2}(?<ddz>[^<]*)([^>]*>){2}(?<zdl>[^<]*)([^>]*>){2}(?<tcl>[^<]*)([^>]*>){2}(?<ddxh>[^<]*)([^>]*>){2}(?<ddxl>[^<]*)([^>]*>){2}(?<tdc>[^<]*)([^>]*>){2}(?<ddc>[^<]*)([^>]*>){2}(?<zdc>[^<]*)([^>]*>){2}(?<xdc>[^<]*)([^>]*>){2}(?<hyd>[^<]*)([^>]*>){2}(?<dsb>[^<]*)([^>]*>){2}(?<tdmr>[^<]*)([^>]*>){2}(?<damc>[^<]*)([^>]*>){2}(?<ddmr>[^<]*)([^>]*>){2}(?<ddmc>[^<]*)([^>]*>){2}(?<zdmr>[^<]*)([^>]*>){2}(?<zdmc>[^<]*)([^>]*>){2}(?<xdmr>[^<]*)([^>]*>){2}(?<xdmc>[^<]*)([^>]*>){2}(?<hsl>[^<]*)([^>]*>){2}(?<lb>[^<]*)";

String Regular = "<tr height=\"25\">([^>]*>){3}(?<StockCode>[^<]*)([^>]*>){3}(?<StockName>[^<]*)([^>]*>){6}(?<trade>[^<]*)([^>]*>){3}(?<UpToPrice>[^<]*)([^>]*>){2}(?<ZF>[^<]*)([^>]*>){2}(?<SZ>[^<]*)([^>]*>){2}(?<SYL>[^<]*)([^>]*>){2}(?<ZF3>[^<]*)([^>]*>){2}(?<ZF_halfyear>[^<]*)([^>]*>){2}(?<je>[^<]*)([^>]*>){2}(?<ddx>[^<]*)([^>]*>){2}(?<ddy>[^<]*)([^>]*>){2}(?<ddz>[^<]*)([^>]*>){2}(?<zdl>[^<]*)([^>]*>){2}(?<tcl>[^<]*)([^>]*>){2}(?<ddxh>[^<]*)([^>]*>){2}(?<ddxl>[^<]*)([^>]*>){2}(?<tdc>[^<]*)([^>]*>){2}(?<ddc>[^<]*)([^>]*>){2}(?<zdc>[^<]*)([^>]*>){2}(?<xdc>[^<]*)([^>]*>){2}(?<hyd>[^<]*)([^>]*>){2}(?<dsb>[^<]*)([^>]*>){2}(?<tdmr>[^<]*)([^>]*>){2}(?<damc>[^<]*)([^>]*>){2}(?<ddmr>[^<]*)([^>]*>){2}(?<ddmc>[^<]*)([^>]*>){2}(?<zdmr>[^<]*)([^>]*>){2}(?<zdmc>[^<]*)([^>]*>){2}(?<xdmr>[^<]*)([^>]*>){2}(?<xdmc>[^<]*)([^>]*>){2}(?<hsl>[^<]*)([^>]*>){2}(?<lb>[^<]*)";

然后爆了这么一个错

Exception in thread "main" java.util.regex.PatternSyntaxException: named capturing group is missing trailing '>' near index 259

加载中
0
刘邵博
刘邵博

你这要是解析什么,好繁琐的正则

达文西W
达文西W
http://www.shdjt.com/flsort.asp?lb=993505这个网页的数据
0
蓝风970655147
蓝风970655147
该评论暂时无法显示,详情咨询 QQ 群:点此入群
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部