\<number>表示反向引用,引用group(number)表示的内容

最外层括号的group-id就是1,向内依次增加

 print(re.findall(r'((.)\2*)', ""))
# output is [('111', '1'), ('22', '2'), ('11', '1'), ('33', '3')]

regex back-reference的更多相关文章

  1. Regex quick reference

    近段时间,接触正则较多,常规法则如下,网摘内容,方便查阅.

  2. Springfox Reference Documentation

    1. Introduction The Springfox suite of java libraries are all about automating the generation of mac ...

  3. springdata整合mongodb一些方法包括or,and,regex等等《有待更新》

    这几天接触mongodb以及springdata,自己英语比较戳,所以整理这些方法花的时间多了点,不过也是我第一次在外国网站整理技术 不多说,直接上代码,这里只是给出一些操作方法而已,如果有需要源码的 ...

  4. Java Regex match IP address

    Reference: [1] https://www.mkyong.com/regular-expressions/how-to-validate-ip-address-with-regular-ex ...

  5. Django Model field reference

    ===================== Model field reference ===================== .. module:: django.db.models.field ...

  6. Hibernate Validator 6.0.9.Final - JSR 380 Reference Implementation: Reference Guide

    Preface Validating data is a common task that occurs throughout all application layers, from the pre ...

  7. mongodb 字符串查找匹配中$regex的用法

    官网地址:https://docs.mongodb.com/manual/reference/operator/query/regex/#regex-case-insensitive 举个例子来说:现 ...

  8. Bug Bounty Reference

    https://github.com/ngalongc/bug-bounty-reference/blob/master/README.md#remote-code-execution Bug Bou ...

  9. 「caffe编译bug」 undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11

    CXX/LD -o .build_release/tools/test_net.binCXX/LD -o .build_release/tools/convert_annoset.binCXX/LD ...

  10. Spring Boot Reference Guide

    Spring Boot Reference Guide Authors Phillip Webb, Dave Syer, Josh Long, Stéphane Nicoll, Rob Winch,  ...

随机推荐

  1. soapui调用redis,获取短信验证码

    1.首先,调用redis需要引入redis的jar包,放入到soapui指定目录中,例如我的目录D:\Program Files\SmartBear\SoapUI-Pro-5.1.2\bin\ext ...

  2. Git命令行基本操作

    Git--- download网址:https://git-scm.com/downloads 0. 安装Git 网上有很多Git安装教程,如果需要图形界面,windows下建议使用TortoiseG ...

  3. 4、 LwIP协议栈规范翻译——流程模型

    4.流程模型 协议实现的流程模型描述了系统被划分为不同的流程的方式.用于实现通信协议的一个流程模型是让每个协议作为一个独立的进程运行.有了这个模型,严格的协议分层被强制执行,并且协议之间的通信点必须严 ...

  4. python进阶(四) windows下虚拟环境使用

    虚拟环境作用: 1. 通常开发一个项目,会安装很多的第三方包,这时第三方包我们是安装在本机环境的.那么如果项目进行部署或移植的时候是不是要重新安装这些包???? 2.开发环境,同时在做两相项目,同时要 ...

  5. 与数论的厮守01:素数的测试——Miller Rabin

    看一个数是否为质数,我们通常会用那个O(√N)的算法来做,那个算法叫试除法.然而当这个数非常大的时候,这个高增长率的时间复杂度就不够这个数跑了. 为了解决这个问题,我们先来看看费马小定理:若n为素数, ...

  6. input file 上传 判断文件类型、路径是否为空

    <html> <body bgcolor="white"> <TABLE cellSpacing=0 cellPadding=0 width=&quo ...

  7. 安装OpenResty开发环境

    OpenResty是一个基于 Nginx 与 Lua 的高性能 Web 平台,其内部集成了大量精良的 Lua 库.第三方模块以及大多数的依赖项.用于方便地搭建能够处理超高并发.扩展性极高的动态 Web ...

  8. 使用 mysqladmin debug 查看死锁信息

    使用 mysqladmin debug 查看死锁信息 mysqladmin -S /mysql/data/mysql.sock debug 然后在error日志中,会看到: 11 lock struc ...

  9. nginx-高并发配置 第七章

    一 .nginx 服务配置优化: 1.nginx进程数,建议按照cpu数目来指定,一般为它的倍数.worker_processes 定义了nginx对外提供web服务时的worker进程数.最优值取决 ...

  10. Uncaught SyntaxError: Unexpected token <解决方法

    最近剥离基础框架的公共部分,早上有个页面部分流程未加载出来,报了Uncaught SyntaxError: Unexpected token <,网上搜了下 错误原因:js脚本中非正常引用外部的 ...