<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE ... ]>
<abc-config version="THIS" id="abc">
...
</abc-config>
大家好
在上面的代码中,如何在 Groovy/Java 中使用 Regex 提取版本属性的值?
谢谢。
最佳答案
处理这个问题的正则表达式可能是这样的:
/<\?xml version="([0-9.]+)"/
关于不使用正则表达式解析标记语言的 10000 堂课,我将省去其中的一堂。
编辑: The One whose Name cannot be expressed in the Basic Multilingual Plane, He compelled me .
关于java - 使用正则表达式提取 XML 中的属性值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4927717/