📜  正则表达式 emaple py - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:21.782000             🧑  作者: Mango

代码示例1
Python has a module named re to work with RegEx. Here's an example:

import re

pattern = '^a...s$'
test_string = 'abyss'
result = re.match(pattern, test_string)

if result:
  print("Search successful.")
else:
  print("Search unsuccessful.")