首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >IMDB数据库的正则表达式

IMDB数据库的正则表达式
EN

Stack Overflow用户
提问于 2014-12-15 04:18:21
回答 1查看 131关注 0票数 1

我是一个基本的编码器和非常新的正则表达式。我需要过滤下面的输入到下面指定的输出中,我需要它作为我的分配任务的输入。有人能帮助我单独编写正则表达式,或者至少提供指导吗?还有什么其他方法可以做到这一点吗?

输入:

代码语言:javascript
复制
A Gathering of Eagles (1963)  (uncredited)  [Mrs. Josten]           
The Creed of Violence (????)  (rumored) 
A Life of Her Own (1950)  (uncredited)  [Model]         
Pourvu qu'elles soient douces (Libertine II) (1989)  [William]  <6>
A Virgin in Hollywood (1953)  [Darla Sloan]  <1>            
Gordon-Levitt, Joseph   (500) Days of Summer (2009)
Aaron Slick from Punkin Crick (1952)  (uncredited)  [Showgirl]      
Cruisin (On a Saturday Night) (2009) {{SUSPENDED}}  [Officer Hernandez]
Angels in Disguise (1949)  (uncredited)  [Reception Nurse]          
The Candid Camera Story (Very Candid) of the Metro-Goldwyn-Mayer Pictures 1937 Convention (1937)  (uncredited)  [Himself]
Annie Get Your Gun (1950)  (uncredited)  [Carriage Woman]   
From the Ashes (2011/I)  (voice)  [Himself - Narrator]      
Bachelor in Paradise (1961)  (uncredited)  [Minor Role]
The Deep Blue Goodbye (????)  (rumored)  [Travis McGee]
Southpaw (????)  (uncredited)  [Spectator/High Roller]

输出

代码语言:javascript
复制
A Gathering of Eagles (1963)
A Life of Her Own (1950)
Pourvu qu'elles soient douces (Libertine II) (1989)
A Virgin in Hollywood (1953)
Gordon-Levitt, Joseph   (500) Days of Summer (2009)
Aaron Slick from Punkin Crick (1952)
Cruisin (On a Saturday Night) (2009)
Angels in Disguise (1949)
The Candid Camera Story (Very Candid) of the Metro-Goldwyn-Mayer Pictures 1937 Convention (1937)
Annie Get Your Gun (1950)
From the Ashes (2011/I)
Bachelor in Paradise (1961)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-12-15 04:21:20

这样就行了

代码语言:javascript
复制
^.*?\(\d\d\d\d.*?\)

在Java中,尝试

代码语言:javascript
复制
Pattern.compile("^.*?\\(\\d\\d\\d\\d.*?\\)", Pattern.MULTILINE)
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27477286

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档