combine-re-compile-0.0.3
توضیحات
combine re compile
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | combine-re-compile-0.0.3 |
| نام | combine-re-compile |
| نسخه کتابخانه | 0.0.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | landybird |
| ایمیل نویسنده | 1442172978@qq.com |
| آدرس صفحه اصلی | https://github.com/landybird/combine_re_compile |
| آدرس اینترنتی | https://pypi.org/project/combine-re-compile/ |
| مجوز | - |
# 任意组合 re.compile
[](https://pypi.org/project/combine-re-compile/) [](https://opensource.org/licenses/MIT)
> 兼容环境
`Windows`/`Linux`/`MacOs`
<br>
### 1 安装
> pip 安装
```
$ pip install combine_re_compile
```
> 源码安装
```
$ git clone https://github.com/landybird/combine_re_compile.git
$ cd combine_re_compile
$ python setup.py install
```
<br>
### 2 使用
```python
DIGIT_PATTERN = re.compile(r"""
(?P<my_digit_pattern> # start named group
\d+ # 1 or more integers
) # close named group
""", re.VERBOSE)
CHAR_PATTERN = re.compile(r"""
(?P<my_char_pattern> # start named group
[a-z] # a character
) # close named group
""", re.VERBOSE)
CHARS_PATTERN = re.compile(r"""
(?P<my_char_pattern> # start named group
[a-z]+ # a character
) # close named group
""", re.VERBOSE)
r = CombinationPattern(DIGIT_PATTERN, CHAR_PATTERN, new_pattren_name="my_new_pattern").get_new_pattern
s = "213213as2312"
print(r.search(s).group('my_new_pattern')) # 分组名称
>> 213213a
```
### License
MIT [©landybird](https://github.com/landybird)
نحوه نصب
نصب پکیج whl combine-re-compile-0.0.3:
pip install combine-re-compile-0.0.3.whl
نصب پکیج tar.gz combine-re-compile-0.0.3:
pip install combine-re-compile-0.0.3.tar.gz