(1983) The Handsome Hunter Of Africa (HD, 1080p).gif
我试图使用正则表达式排除关键字The。
这个正则表达式:
[\w\s-]*([^\d(HD, 1080p\)|\(HD, 720p\)|\(SD, 480p\)|.flv|gif|mkv|mpeg|mpg|mov|)|(])
将事物排除在字符串之外,并且只捕获:The Handsome Hunter Of Africa
我怎样才能从字符串中排除 the 这个词而只能得到:英俊的非洲猎人
我只想在regex中这样做。
发布于 2016-03-17 16:37:24
你可以想出一件事。像这样:
\)\s*The\s*([^())]+)
# look for a closing parenthesis and whitespace, The and whitespace
# afterwards, capture everything but parenthesis greedily
# this is saved in a group
# will yield: Handsome Hunter Of Africa 见regex101.com上的演示。您需要加倍地转义Java的正则表达式。
发布于 2016-03-17 19:26:16
https://stackoverflow.com/questions/36066477
复制相似问题