定期exp [在XSLT中的ression

时间:2016-12-03 09:49:52

标签: regex xslt

在XSLT中,有人可以帮助我理解这一点。

regexp:match(test-graph.api.example.com, '(?=CN).*\.(.*)(\.)(.*)(?<=com)', 'i')

输出是什么以及如何解释这个正则表达式。

请告诉我

1 个答案:

答案 0 :(得分:-1)

应该这样阅读:

(?=CN).*\.(.*)(\.)(.*)(?<=com)

说明:

.* matches any character (except for line terminators)
    * Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)
\. matches the character . literally (case sensitive)
1st Capturing Group (.*)
.* matches any character (except for line terminators)
    * Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)
2nd Capturing Group (\.)
\. matches the character . literally
3rd Capturing Group (.*)
.* matches any character (except for line terminators)
    * Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)
Positive Lookbehind (?<=com)
Assert that the Regex below matches
com matches the characters com literally 

i修饰符表示正则表达式是 i nsentive。