跳过前nn个字符,其余则使用RegEx [英] Skip first nn characters, take the rest with RegEx

查看:59
本文介绍了跳过前nn个字符,其余则使用RegEx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到一个问题,它使用了记事本++ / pcre中存在的\K / PHP(重置匹配起点)。但是,在精通正则表达式或正则表达式食谱中找不到此选项或其等效项。

I saw a question that used \K that exists in Notepad++/pcre/PHP (reset starting point of match). However, I cannot find this option or its equivalent in Mastering Regular Expressions or Regular Expression Cookbook.

如何跳过指定数量的字符?我使用Expresso在^。{15}上执行了替换操作,从而消除了前15个。我在正确的轨道上吗?还是有更好的方法?

How do I go about skipping a specified number of characters? I used Expresso to do a Replace on ^.{15}, which eliminates the first 15. Am I on the right track, or is there a better way?

推荐答案

给出(?< =。{15})。+ 试试。

在这里玩: http://refiddle.com/2te3

这篇关于跳过前nn个字符,其余则使用RegEx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆