Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rex-plus

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rex-plus

You can match and replace strings with regular expressions.

  • 0.1.4
  • PyPI
  • Socket score

Maintainers
1

📦 rex-plus (for humans)

Plus version of re

Installation

pip install -i https://mirrors.aliyun.com/pypi/simple/ --extra-index-url https://pypi.org/simple/ rex-plus

Example

import rex_plus
# 正则替换
# Partial replacement according to regular expression
rex_plus.sub('(限行)灯', ['线型'], '卧室有一盏限行灯')
# output: '卧室有一盏线型灯'
rex_plus.sub('(我是).*(限行)灯', ['卧室', '线型'], '卧室有一盏限行灯')
# output: 卧室有一盏线型灯
rex_plus.sub('(?:卧室)的(限行)灯', ['线型'], '卧室的限行灯')
# output: 卧室的线型灯
rex_plus.sub('(?:(我是)的)(限行)灯', ['卧室', '线型'], '卧室的限行灯')
# output: 卧室的线型灯
# 查询所有匹配项,并返回对应的index和text
rex_plus.search_all(r"\d", "__a1bb2ccc3")
# output: [<rex_plus.Match object; span=(3, 4), text='1'>, <rex_plus.Match object; span=(6, 7), text='2'>, <rex_plus.Match object; span=(10, 11), text='3'>]

To Do

  • Be the best version of you.

More Resources

  • rex-plus on github.com
  • Official Python Packaging User Guide
  • The Hitchhiker's Guide to Packaging
  • Cookiecutter template for a Python package

License

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc