0
A
回答
2
[]
用於在正則表達式中定義字符集。如果字符串包含該集合中的任何字符,則表達式將匹配。
你的正則表達式:
r"['a', 'b']"
說:「如果匹配字符串包含'
或a
或,
或b
作爲@Patrick霍先生提到在他的評論你的表情相當於[',ab]
重複相同的字符。該設置什麼都不做
http://www.regexpal.com/是一個偉大的網站,用於測試你的正則表達式,它可以幫助你分解它,並解釋你的表達做什麼以及它爲什麼匹配某些字符串。
相關問題
- 1. Python的正則表達式:「喜歡」正則表達式模式?
- 2. 正則表達式正則表達式正則表達式使用正則表達式,但不是與Python
- 3. Python的正則表達式?
- 4. Python的正則表達式
- 5. Python的正則表達式
- 6. Python的正則表達式
- 7. Python的正則表達式{
- 8. Python的正則表達式
- 9. 正則表達式python表達式
- 10. Python的正則表達式刪除Word用正則表達式
- 11. 來自Socket數據的Python - 正則表達式通配符?
- 12. 正則表達式來
- 13. 正則表達式來
- 14. Python Unicode正則表達式
- 15. Python和正則表達式
- 16. 正則表達式或Python
- 17. Python正則表達式Findall
- 18. Python - 正則表達式dir
- 19. python re.sub正則表達式
- 20. Python正則表達式
- 21. 正則表達式python 3.4
- 22. Python正則表達式子
- 23. python正則表達式appengine
- 24. 正則表達式在Python
- 25. 在python正則表達式
- 26. 正則表達式python
- 27. Python 3.3正則表達式?
- 28. 正則表達式在Python
- 29. Python正則表達式
- 30. Python正則表達式
我們可以看到正則表達式的實現嗎? –
你有沒有試過閱讀文檔https://docs.python.org/2/library/re.html? –
'['a','b']'與'[',ab]' –