我有网址'http:abc.com/test/test1/123-343$fsdsf$gdgdgfdgfdg35435435'
我想在'http:abc.com/test/test1/'之后选择36个字符我写了正则表达式(?<=http[s]?://abc.com/\w*/\w*/)匹配模式。 问题在于选择器。 我希望在模式匹配后选择下一个36个字符。
我正在尝试(?<=http[s]?://abc.com/\w*/\w*/){36}但它无效。
最大的问题是在模式匹配之后,可能存在少于36个字符。 我也想处理这种情况。 即如果模式匹配后出现的字符小于36,则选择模式匹配后出现的字符数。
I am having url 'http:abc.com/test/test1/123-343$fsdsf$gdgdgfdgfdg35435435'
i want to select 36 characters occur after 'http:abc.com/test/test1/' i had wrote regex (?<=http[s]?://abc.com/\w*/\w*/) which match the pattern. The problem is with selector. i want to select next 36 char after pattern match.
i was trying (?<=http[s]?://abc.com/\w*/\w*/){36} but it is not working.
the big problem is after pattern match there can be less than 36 char present. i want to handle this situation as well. i.e If char present after pattern match are less than 36, then select what ever number of char present after pattern match.
最满意答案
(?<=https?:\/?\/?abc\.com\/[^\/]*\/[^\/]*\/).{1,36}你可以试试这个。 {1,36}即使小于36也可以捕获角色。
(?<=https?:\/?\/?abc\.com\/[^\/]*\/[^\/]*\/).{1,36}You can try this.{1,36} will allow to capture character even if it less than 36.
更多推荐
发布评论