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.
我想在使用IMDbPY从 IMDB 中提取数据时提取货币价值。
我的问题是 IMDbPY 以以下格式返回结果,什么是 unicode 字符串:
In : movie['business']['gross'][0] Out: u'$134,966,411 (USA) (11 May 1997)'
此外,日期有时存在,有时不存在。
你能帮我如何从这个字符串中提取数字,而不会意外识别日期/年份部分吗?
货币符号和国家代码并不重要。
re.match使用这种模式:
re.match
r"\$([1-9][0-9,]+)"