Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

python-reformat

Project description

格式化正则内容输出
===============

$0、$1、$2 分别对应 match中的g0、g1、g2、g3

multi是否为多重匹配,是则返回所有结果,否则返回首匹配



>>> data = '12m34kjdg8946o'
>>> pn = '(\d)([a-z])'
>>> fm = '$1,$2'
>>> result = extract(pn, data, fm)
>>> result
'2,m'
>>> result = extract(pn, data, fm, multi= True)
>>> result
['2,m', '4,k', '6,o']

Project details


Release history Release notifications

This version
History Node

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
python-reformat-0.1.tar.gz (2.1 kB) Copy SHA256 hash SHA256 Source None Jul 1, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page