¸üÐÂʱ¼ä:2021Äê03ÔÂ05ÈÕ17ʱ55·Ö À´Ô´:ÀÖÓãµç¾º ä¯ÀÀ´ÎÊý:

import re
example = "<li>goods</li><li>name</li>"
# ̰À·Ä£Ê½
greed_pattern = re.compile("<li>.*</li>")
# ·Ç̰À·Ä£Ê½
not_greed_pattern = re.compile("<li>.*?</li>")
greed_result = greed_pattern.search(example)
not_greed_result = not_greed_pattern.search(example)
print(f"̰À·Ä£Ê½£º{greed_result.group()}")
print(f"·Ç̰À·Ä£Ê½£º{not_greed_result.group()}")
£¨4£©½áºÏÏîÄ¿ÖÐʹÓÃcomplie()º¯ÊýÔ¤±àÒëÕýÔò±í´ïʽ
PythonÕýÔò±í´ïʽreÄ£¿é³£Óú¯ÊýÓÐÄÄЩ£¿
ʹÓÃDjangoÖмä¼þµÄÁùÖÖ·½·¨[pythonÅàѵ]
ÀÖÓãµç¾ºpython+Êý¾Ý·ÖÎö¿Î³Ì
HTTPͨÐÅ»úÖÆÖеÄÒ»´ÎÍêÕûͨÐŹý³ÌµÄ7¸ö²½Öè
2021-02-26ʲôÊǹ¶ù½ø³ÌºÍ½©Ê¬½ø³Ì£¿ÈçºÎ±ÜÃ⽩ʬ½ø³Ì£¿
2021-02-26Pythonʵս¿ª·¢ÏîÄ¿ÊÓÆµ½Ì³Ì£ºÃÀ¶àÉ̳ǿª·¢ÊµÕ½¡¾ÀÖÓãµç¾º¡¿
2021-02-22NumPyÊý×éÓм¸ÖÖ´´½¨·½·¨£¿
2021-02-03complie()º¯ÊýÔ¤±àÒëÕýÔò±í´ïʽ
2021-01-28PythonµÄÃæÏò¶ÔÏóÓëÃæÏò±à³ÌÓÐÊ²Ã´Çø±ð£¿
2021-01-28
±±¾©Ð£Çø