【发布时间】:2018-05-14 07:37:36
【问题描述】:
例如:
- (id)initWithFrame:(CGRect)frame ;
- (NSUInteger)hideAllHUDsForView:(UIView *)view animated:(BOOL)animated ;
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context ;
我想获取参数 eg:frame view animated keyPath...,) 和空格之间的参数,shell 上的 grep 怎么办?
【问题讨论】:
-
有很多
)s。你怎么知道你想找到哪一个?模式是什么? -
grep -E "frame|animated|view|keyPath" someFile也许? -
这就是我想问的。我写了这个
egrep -o ').* ' filename,但它与整行匹配。 -
@Mark Setchell ,不是固定的,像三行这样的行要多得多。