Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Python で regexp 検索操作を実行してすべてに一致させたいのですが、1 文字 (この例では最後にあります):
expression = re.compile(r'http:\/\/.*')
上記の正規表現は url: 全体に一致します。http://stackoverflow.com/questions/ask;私がやりたいのは、最後の;文字なしで一致させることです。
http://stackoverflow.com/questions/ask;
;
dot (.)末尾の代わりに否定文字クラスを使用できます: -
dot (.)
expression = re.compile(r'http:\/\/[^;]*')