Created
May 8, 2019 03:03
-
-
Save hieast/1fc9e5dad298a62178236c0c7bf9f035 to your computer and use it in GitHub Desktop.
自己看结果
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
origin = "abcdefghigkqpwueriwutghlskajdf,mnbz,xcnvoiequynf12341234321065498+7mnbz,xcnvoiequynf12341234321065498+7mnbz,xcnvoiequynf12341234321065498+7mnbz,xcnvoiequynf12341234321065498+7" | |
meta = "mn" | |
pattern = re.compile("mn") | |
assert origin.replace(meta, "") == pattern.sub("", origin) | |
%timeit(origin.replace(meta, "")) | |
%timeit(pattern.sub("", origin)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment