#regex 用于验证 URL 验证
#regex for validate URL validation
我有以下URL
https://domain.xyz/version/path/node
节点可以更改,但格式必须相同
#regex '[0-9a-z]{9}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}'
我已经阅读了文档并查找了示例,但我无法使其正常工作。
如何在空手道中做到这一点?
就像这样:
* def myUrl = 'https://domain.xyz/version/path/blah-blah'
* def pos = myUrl.lastIndexOf('/')
* def node = myUrl.substring(pos + 1)
* match node == '#regex [0-9a-z]{4}-[0-9a-z]{4}'
我有以下URL
https://domain.xyz/version/path/node
节点可以更改,但格式必须相同
#regex '[0-9a-z]{9}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}'
我已经阅读了文档并查找了示例,但我无法使其正常工作。
如何在空手道中做到这一点?
就像这样:
* def myUrl = 'https://domain.xyz/version/path/blah-blah'
* def pos = myUrl.lastIndexOf('/')
* def node = myUrl.substring(pos + 1)
* match node == '#regex [0-9a-z]{4}-[0-9a-z]{4}'