Skip to main content

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 | RSS feed

This version

0.1

Download files

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

Files for python-reformat, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size python-reformat-0.1.tar.gz (2.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page