[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/ZPpythonhome/Python-1/master/python14/1.md [Back]  [Original]

#  Python 



Python  1.5 re  Perl re  Python 





```python
# 
a = '|twowater|liangdianshui||ReadingWithU'

#    PY 

print('{0}'.format(a.index('') > -1))
print('{0}'.format('' in a))
```



```txt
True
True
```



Python  re 

```python
re.findall(pattern, string[, flags])
```

,

```python

import re

# 
a = '|twowater|liangdianshui||ReadingWithU'

# 

findall = re.findall('', a)
print(findall)

if len(findall) > 0:
    print('a ')
else:
    print('a ')

```



```txt
['']
a 
```



 Python 

 `findall` 	`[a-z]` 

```python

import re

# 
a = '|twowater|liangdianshui||ReadingWithU'

#  a 

re_findall = re.findall('[a-z]', a)

print(re_findall)

```



```txt
['t', 'w', 'o', 'w', 'a', 't', 'e', 'r', 'l', 'i', 'a', 'n', 'g', 'd', 'i', 'a', 'n', 's', 'h', 'u', 'i', 'e', 'a', 'd', 'i', 'n', 'g', 'i', 't', 'h']
```



Web Proxy Viewer  |  New URL  |  Original Page