Skip to content

Instantly share code, notes, and snippets.

@BuckyI
Last active April 1, 2023 12:00
Show Gist options
  • Save BuckyI/cb07edf1f24917fbc637538272100253 to your computer and use it in GitHub Desktop.
Save BuckyI/cb07edf1f24917fbc637538272100253 to your computer and use it in GitHub Desktop.
正则表达式

正则表达式匹配

[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12} uuid

import re

string = "Hello.mp4"
re.sub(r"(.*?)\.", "\g<1> - YouTube.", string)
# 'Hello - YouTube.mp4'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment