我正在尝试解析以下行,myline in Java 并且它不断抛出空值。
这是我尝试获取“000000010”的方法。
myline = "<status> <id>000000010</id> <created_at>2012/03/11</created_at> <text>@joerogan Played as Joe Savage Rogan in Undisputed3 Career mode, won Pride GP, got UFC title shot against Shields, lost 3 times, and retired</text> <retweet_count>0</retweet_count> <user> <name>Siggi Eggertsson</name> <location>Berlin, Germany</location> <description></description> <url>http://www.siggieggertsson.com</url> </user></status>"
p = Pattern.compile("(?i)<id.*?>(.+?)</id>", Pattern.DOTALL);
m = regex.matcher(myline);
id =m.group(1);
有什么建议吗?