She*_*lam 4 regex iphone cocoa-touch objective-c ios
我有以下正则表达式,我想在Objective-C中逃避
/\B\$((?:[0-9]+(?=[a-z])|(?![0-9\.\:\_\-]))(?:[a-z0-9]|[\_\.\-\:](?![\.\_\.\-\:]))*[a-z0-9]+)/ig;
Run Code Online (Sandbox Code Playgroud)
不完全确定如何逃避它,因此它在Objective-C中工作
更新:
NSString* pattern = @"/\\B\\$((?:[0-9]+(?=[a-z])|(?![0-9\\.\\:\\_\\-]))(?:[a-z0-9]|[\\_\\.\\-\\:](?![\\.\\_\\.\\-\\:]))*[a-z0-9]+)/ig;";
NSRegularExpression *usernameRegex = [[[NSRegularExpression alloc] initWithPattern:pattern
options:NSRegularExpressionCaseInsensitive
error:nil];
error:nil];
Run Code Online (Sandbox Code Playgroud)
给我一个错误 Parse Issue - Unexpected Identifier
| 归档时间: |
|
| 查看次数: |
4119 次 |
| 最近记录: |