姝e垯琛ㄨ揪寮-璐┆涓庢噿鎯 python绡

浜虹敓鑻︾煭锛屾垜鐢╬ython

#coding=utf-8
import re

line = "aooooaay123"
reg_str = ".*(a.*a).*"
match_obj = re.match(reg_str,line)
if match_obj:
    print(match_obj.group(1))

杈撳嚭缁撴灉aa
涓轰粈涔堟槸aa鑰屼笉鏄痑ooooa鍛
鎴戞槸杩欐牱瀛愮悊瑙g殑锛屾鍒欓氬父鐨勮涓烘槸灏藉彲鑳藉鐨勫尮閰嶏紝鎵浠ュ湪

.*

鐨勬椂鍊欎粬鍙互鍖归厤鍒癮ooooa锛屾墍浠ラ噷闈㈢殑鎷彿鎵嶄細鍖归厤鍒癮a
鎷彿鐨勬剰鎬濇槸瀛愰泦
鎵浠ュ鏋滄垜鎯冲尮閰嶅埌aooooa鐨勮瘽鎴戝氨搴旇灏唋ine鏀逛负

reg_str = ".*?(a.*?a).*"

?鍙风殑鎰忔濇槸鎳掓儼妯″紡 灏藉彲鑳藉尮閰嶅皯涓鐐
杈撳嚭缁撴灉鎵嶆槸aooooa

All posts

Other pages


Deprecated: 鏂囦欢 娌℃湁 comments.php 鐨勪富棰 鑷増鏈 3.0.0 璧峰凡寮冪敤锛屼笖娌℃湁鍙敤鐨勬浛浠c 璇峰湪鎮ㄧ殑涓婚涓寘鍚竴涓 comments.php 妯℃澘銆 in /www/wwwroot/liguoqi.site/wp-includes/functions.php on line 6078

鍙戣〃鍥炲

鎮ㄧ殑鐢靛瓙閭鍦板潃涓嶄細琚叕寮銆 蹇呭~椤瑰凡鐢 * 鏍囨敞