格式不断变化时从xml中获取日期

时间:2013-01-24 14:02:44

标签: java

如果使用Java不断更改XML格式的格式,如何从XML文档中获取日期:

有时会是

<date> from 1:00 pm to 2<00 pm it was raining<\date>

有时会是

<date> between 1:00 pm and 2<00 pm it was raining<\date>

有时会是

<date> from 1:00 pm & 2<00 pm it was raining<\date>

有时会是

<date> from 1:00 to 2<00 pm it was raining<\date>

1 个答案:

答案 0 :(得分:0)

假设您无法将文档更改为使用相同的格式,则必须使用正则表达式。有关详细信息,请参阅Pattern Documentation