├── .gitignore ├── screenshot.png ├── RegexKitLiteDebugger ├── en.lproj │ ├── InfoPlist.strings │ └── Credits.rtf ├── RegexKitLiteDebugger-Prefix.pch ├── main.m ├── RDAppDelegate.h ├── RegexKitLiteDebugger-Info.plist ├── RDAppDelegate.m └── RegexKitLite.h ├── README.md └── RegexKitLiteDebugger.xcodeproj ├── project.xcworkspace ├── contents.xcworkspacedata └── xcuserdata │ └── wutian.xcuserdatad │ └── UserInterfaceState.xcuserstate ├── xcuserdata └── wutian.xcuserdatad │ └── xcschemes │ ├── xcschememanagement.plist │ └── RegexKitLiteDebugger.xcscheme └── project.pbxproj /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Naituw/RegexKitLiteDebugger/HEAD/screenshot.png -------------------------------------------------------------------------------- /RegexKitLiteDebugger/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | RegexKitLite Debugger 2 | ==================== 3 | 4 | 5 | RegexKitLite的调试器,适用于硬编码正则表达式字符串并使用RegexKitLite进行解析的调试。 6 | 7 | 8 | ![ScreenShot](https://raw.github.com/Naituw/RegexKitLiteDebugger/master/screenshot.png) 9 | 10 | -------------------------------------------------------------------------------- /RegexKitLiteDebugger/RegexKitLiteDebugger-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'RegexKitLiteDebugger' target in the 'RegexKitLiteDebugger' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /RegexKitLiteDebugger.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RegexKitLiteDebugger.xcodeproj/project.xcworkspace/xcuserdata/wutian.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Naituw/RegexKitLiteDebugger/HEAD/RegexKitLiteDebugger.xcodeproj/project.xcworkspace/xcuserdata/wutian.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /RegexKitLiteDebugger/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // RegexKitLiteDebugger 4 | // 5 | // Created by Wutian on 13-5-31. 6 | // Copyright (c) 2013年 wutian. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **)argv); 14 | } 15 | -------------------------------------------------------------------------------- /RegexKitLiteDebugger/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /RegexKitLiteDebugger/RDAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // RDAppDelegate.h 3 | // RegexKitLiteDebugger 4 | // 5 | // Created by Wutian on 13-5-31. 6 | // Copyright (c) 2013年 wutian. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RDAppDelegate : NSObject 12 | 13 | @property (assign) IBOutlet NSWindow *window; 14 | 15 | @property (assign) IBOutlet NSTextField * regexTextField; 16 | @property (assign) IBOutlet NSTextView * contentTextView; 17 | @property (assign) IBOutlet NSTextView * resultTextView; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /RegexKitLiteDebugger.xcodeproj/xcuserdata/wutian.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | RegexKitLiteDebugger.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | C63891611758AA400005069A 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /RegexKitLiteDebugger/RegexKitLiteDebugger-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.wutian.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2013年 wutian. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /RegexKitLiteDebugger/RDAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // RDAppDelegate.m 3 | // RegexKitLiteDebugger 4 | // 5 | // Created by Wutian on 13-5-31. 6 | // Copyright (c) 2013年 wutian. All rights reserved. 7 | // 8 | 9 | #import "RDAppDelegate.h" 10 | #import "RegexKitLite.h" 11 | 12 | @implementation RDAppDelegate 13 | 14 | - (void)dealloc 15 | { 16 | [super dealloc]; 17 | } 18 | 19 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification 20 | { 21 | [self.regexTextField.cell setFocusRingType:NSFocusRingTypeNone]; 22 | 23 | self.contentTextView.font = [NSFont fontWithName:@"Menlo" size:13]; 24 | self.contentTextView.textContainerInset = NSMakeSize(0, 3); 25 | 26 | self.resultTextView.textContainerInset = NSMakeSize(0, 3); 27 | } 28 | 29 | - (void)updateResult 30 | { 31 | // 获取填写的正则和内容 32 | NSString * regex = self.regexTextField.stringValue; 33 | NSString * content = self.contentTextView.string; 34 | 35 | // 首先对regex进行逆转义,模拟硬编码时声明NSString的情况 36 | NSMutableString * unescapedRegex = [NSMutableString stringWithString:regex]; 37 | 38 | #define Replace(string,with) [unescapedRegex replaceOccurrencesOfString:string withString:with options:0 range:NSMakeRange(0, unescapedRegex.length)] 39 | 40 | Replace(@"\\\'", @"\'"); 41 | Replace(@"\\\"", @"\""); 42 | Replace(@"\\\?", @"\?"); 43 | Replace(@"\\\\", @"\\"); 44 | // \n, \t, \b 在此不考虑 45 | 46 | 47 | // 使用逆转义过的正则进行解析并更新resultTextView 48 | NSRange contentRange = NSMakeRange(0, content.length); 49 | [self.resultTextView setString:content]; 50 | [self.resultTextView.textStorage removeAttribute:NSFontAttributeName range:contentRange]; 51 | [self.resultTextView.textStorage removeAttribute:NSBackgroundColorAttributeName range:contentRange]; 52 | 53 | [self.resultTextView.textStorage addAttribute:NSFontAttributeName value:[NSFont fontWithName:@"Menlo" size:13] range:contentRange]; 54 | 55 | [content enumerateStringsMatchedByRegex:unescapedRegex options:0 inRange:NSMakeRange(0, content.length) error:NULL enumerationOptions:0 usingBlock:^(NSInteger captureCount, NSString *const *capturedStrings, const NSRange *capturedRanges, volatile BOOL *const stop) { 56 | 57 | NSRange range = capturedRanges[0]; 58 | 59 | [self.resultTextView.textStorage addAttribute:NSBackgroundColorAttributeName value:[NSColor redColor] range:range]; 60 | }]; 61 | } 62 | 63 | #pragma mark - Delegate Methods 64 | 65 | - (void)controlTextDidChange:(NSNotification *)obj 66 | { 67 | if (obj.object == self.regexTextField) 68 | { 69 | [self updateResult]; 70 | } 71 | } 72 | 73 | - (void)textDidChange:(NSNotification *)notification 74 | { 75 | if (notification.object == self.contentTextView) 76 | { 77 | [self updateResult]; 78 | } 79 | } 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /RegexKitLiteDebugger.xcodeproj/xcuserdata/wutian.xcuserdatad/xcschemes/RegexKitLiteDebugger.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /RegexKitLiteDebugger.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | C63891661758AA400005069A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C63891651758AA400005069A /* Cocoa.framework */; }; 11 | C63891701758AA400005069A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C638916E1758AA400005069A /* InfoPlist.strings */; }; 12 | C63891721758AA400005069A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C63891711758AA400005069A /* main.m */; }; 13 | C63891761758AA400005069A /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = C63891741758AA400005069A /* Credits.rtf */; }; 14 | C63891791758AA400005069A /* RDAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C63891781758AA400005069A /* RDAppDelegate.m */; }; 15 | C638917C1758AA400005069A /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = C638917A1758AA400005069A /* MainMenu.xib */; }; 16 | C63891841758B1E50005069A /* RegexKitLite.m in Sources */ = {isa = PBXBuildFile; fileRef = C63891831758B1E50005069A /* RegexKitLite.m */; }; 17 | C63891861758B20B0005069A /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = C63891851758B20A0005069A /* libicucore.dylib */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | C63891621758AA400005069A /* RegexKitLiteDebugger.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RegexKitLiteDebugger.app; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | C63891651758AA400005069A /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 23 | C63891681758AA400005069A /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 24 | C63891691758AA400005069A /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 25 | C638916A1758AA400005069A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 26 | C638916D1758AA400005069A /* RegexKitLiteDebugger-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "RegexKitLiteDebugger-Info.plist"; sourceTree = ""; }; 27 | C638916F1758AA400005069A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 28 | C63891711758AA400005069A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29 | C63891731758AA400005069A /* RegexKitLiteDebugger-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RegexKitLiteDebugger-Prefix.pch"; sourceTree = ""; }; 30 | C63891751758AA400005069A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; 31 | C63891771758AA400005069A /* RDAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RDAppDelegate.h; sourceTree = ""; }; 32 | C63891781758AA400005069A /* RDAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RDAppDelegate.m; sourceTree = ""; }; 33 | C638917B1758AA400005069A /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; 34 | C63891821758B1E50005069A /* RegexKitLite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegexKitLite.h; sourceTree = ""; }; 35 | C63891831758B1E50005069A /* RegexKitLite.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RegexKitLite.m; sourceTree = ""; }; 36 | C63891851758B20A0005069A /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = usr/lib/libicucore.dylib; sourceTree = SDKROOT; }; 37 | /* End PBXFileReference section */ 38 | 39 | /* Begin PBXFrameworksBuildPhase section */ 40 | C638915F1758AA400005069A /* Frameworks */ = { 41 | isa = PBXFrameworksBuildPhase; 42 | buildActionMask = 2147483647; 43 | files = ( 44 | C63891861758B20B0005069A /* libicucore.dylib in Frameworks */, 45 | C63891661758AA400005069A /* Cocoa.framework in Frameworks */, 46 | ); 47 | runOnlyForDeploymentPostprocessing = 0; 48 | }; 49 | /* End PBXFrameworksBuildPhase section */ 50 | 51 | /* Begin PBXGroup section */ 52 | C63891591758AA400005069A = { 53 | isa = PBXGroup; 54 | children = ( 55 | C63891851758B20A0005069A /* libicucore.dylib */, 56 | C638916B1758AA400005069A /* RegexKitLiteDebugger */, 57 | C63891641758AA400005069A /* Frameworks */, 58 | C63891631758AA400005069A /* Products */, 59 | ); 60 | sourceTree = ""; 61 | }; 62 | C63891631758AA400005069A /* Products */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | C63891621758AA400005069A /* RegexKitLiteDebugger.app */, 66 | ); 67 | name = Products; 68 | sourceTree = ""; 69 | }; 70 | C63891641758AA400005069A /* Frameworks */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | C63891651758AA400005069A /* Cocoa.framework */, 74 | C63891671758AA400005069A /* Other Frameworks */, 75 | ); 76 | name = Frameworks; 77 | sourceTree = ""; 78 | }; 79 | C63891671758AA400005069A /* Other Frameworks */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | C63891681758AA400005069A /* AppKit.framework */, 83 | C63891691758AA400005069A /* CoreData.framework */, 84 | C638916A1758AA400005069A /* Foundation.framework */, 85 | ); 86 | name = "Other Frameworks"; 87 | sourceTree = ""; 88 | }; 89 | C638916B1758AA400005069A /* RegexKitLiteDebugger */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | C63891771758AA400005069A /* RDAppDelegate.h */, 93 | C63891781758AA400005069A /* RDAppDelegate.m */, 94 | C63891821758B1E50005069A /* RegexKitLite.h */, 95 | C63891831758B1E50005069A /* RegexKitLite.m */, 96 | C638917A1758AA400005069A /* MainMenu.xib */, 97 | C638916C1758AA400005069A /* Supporting Files */, 98 | ); 99 | path = RegexKitLiteDebugger; 100 | sourceTree = ""; 101 | }; 102 | C638916C1758AA400005069A /* Supporting Files */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | C638916D1758AA400005069A /* RegexKitLiteDebugger-Info.plist */, 106 | C638916E1758AA400005069A /* InfoPlist.strings */, 107 | C63891711758AA400005069A /* main.m */, 108 | C63891731758AA400005069A /* RegexKitLiteDebugger-Prefix.pch */, 109 | C63891741758AA400005069A /* Credits.rtf */, 110 | ); 111 | name = "Supporting Files"; 112 | sourceTree = ""; 113 | }; 114 | /* End PBXGroup section */ 115 | 116 | /* Begin PBXNativeTarget section */ 117 | C63891611758AA400005069A /* RegexKitLiteDebugger */ = { 118 | isa = PBXNativeTarget; 119 | buildConfigurationList = C638917F1758AA400005069A /* Build configuration list for PBXNativeTarget "RegexKitLiteDebugger" */; 120 | buildPhases = ( 121 | C638915E1758AA400005069A /* Sources */, 122 | C638915F1758AA400005069A /* Frameworks */, 123 | C63891601758AA400005069A /* Resources */, 124 | ); 125 | buildRules = ( 126 | ); 127 | dependencies = ( 128 | ); 129 | name = RegexKitLiteDebugger; 130 | productName = RegexKitLiteDebugger; 131 | productReference = C63891621758AA400005069A /* RegexKitLiteDebugger.app */; 132 | productType = "com.apple.product-type.application"; 133 | }; 134 | /* End PBXNativeTarget section */ 135 | 136 | /* Begin PBXProject section */ 137 | C638915A1758AA400005069A /* Project object */ = { 138 | isa = PBXProject; 139 | attributes = { 140 | CLASSPREFIX = RD; 141 | LastUpgradeCheck = 0460; 142 | ORGANIZATIONNAME = wutian; 143 | }; 144 | buildConfigurationList = C638915D1758AA400005069A /* Build configuration list for PBXProject "RegexKitLiteDebugger" */; 145 | compatibilityVersion = "Xcode 3.2"; 146 | developmentRegion = English; 147 | hasScannedForEncodings = 0; 148 | knownRegions = ( 149 | en, 150 | ); 151 | mainGroup = C63891591758AA400005069A; 152 | productRefGroup = C63891631758AA400005069A /* Products */; 153 | projectDirPath = ""; 154 | projectRoot = ""; 155 | targets = ( 156 | C63891611758AA400005069A /* RegexKitLiteDebugger */, 157 | ); 158 | }; 159 | /* End PBXProject section */ 160 | 161 | /* Begin PBXResourcesBuildPhase section */ 162 | C63891601758AA400005069A /* Resources */ = { 163 | isa = PBXResourcesBuildPhase; 164 | buildActionMask = 2147483647; 165 | files = ( 166 | C63891701758AA400005069A /* InfoPlist.strings in Resources */, 167 | C63891761758AA400005069A /* Credits.rtf in Resources */, 168 | C638917C1758AA400005069A /* MainMenu.xib in Resources */, 169 | ); 170 | runOnlyForDeploymentPostprocessing = 0; 171 | }; 172 | /* End PBXResourcesBuildPhase section */ 173 | 174 | /* Begin PBXSourcesBuildPhase section */ 175 | C638915E1758AA400005069A /* Sources */ = { 176 | isa = PBXSourcesBuildPhase; 177 | buildActionMask = 2147483647; 178 | files = ( 179 | C63891721758AA400005069A /* main.m in Sources */, 180 | C63891791758AA400005069A /* RDAppDelegate.m in Sources */, 181 | C63891841758B1E50005069A /* RegexKitLite.m in Sources */, 182 | ); 183 | runOnlyForDeploymentPostprocessing = 0; 184 | }; 185 | /* End PBXSourcesBuildPhase section */ 186 | 187 | /* Begin PBXVariantGroup section */ 188 | C638916E1758AA400005069A /* InfoPlist.strings */ = { 189 | isa = PBXVariantGroup; 190 | children = ( 191 | C638916F1758AA400005069A /* en */, 192 | ); 193 | name = InfoPlist.strings; 194 | sourceTree = ""; 195 | }; 196 | C63891741758AA400005069A /* Credits.rtf */ = { 197 | isa = PBXVariantGroup; 198 | children = ( 199 | C63891751758AA400005069A /* en */, 200 | ); 201 | name = Credits.rtf; 202 | sourceTree = ""; 203 | }; 204 | C638917A1758AA400005069A /* MainMenu.xib */ = { 205 | isa = PBXVariantGroup; 206 | children = ( 207 | C638917B1758AA400005069A /* en */, 208 | ); 209 | name = MainMenu.xib; 210 | sourceTree = ""; 211 | }; 212 | /* End PBXVariantGroup section */ 213 | 214 | /* Begin XCBuildConfiguration section */ 215 | C638917D1758AA400005069A /* Debug */ = { 216 | isa = XCBuildConfiguration; 217 | buildSettings = { 218 | ALWAYS_SEARCH_USER_PATHS = NO; 219 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 220 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 221 | CLANG_CXX_LIBRARY = "libc++"; 222 | CLANG_WARN_CONSTANT_CONVERSION = YES; 223 | CLANG_WARN_EMPTY_BODY = YES; 224 | CLANG_WARN_ENUM_CONVERSION = YES; 225 | CLANG_WARN_INT_CONVERSION = YES; 226 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 227 | COPY_PHASE_STRIP = NO; 228 | GCC_C_LANGUAGE_STANDARD = gnu99; 229 | GCC_DYNAMIC_NO_PIC = NO; 230 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 231 | GCC_OPTIMIZATION_LEVEL = 0; 232 | GCC_PREPROCESSOR_DEFINITIONS = ( 233 | "DEBUG=1", 234 | "$(inherited)", 235 | ); 236 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 237 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 238 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 239 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 240 | GCC_WARN_UNUSED_VARIABLE = YES; 241 | MACOSX_DEPLOYMENT_TARGET = 10.8; 242 | ONLY_ACTIVE_ARCH = YES; 243 | SDKROOT = macosx; 244 | }; 245 | name = Debug; 246 | }; 247 | C638917E1758AA400005069A /* Release */ = { 248 | isa = XCBuildConfiguration; 249 | buildSettings = { 250 | ALWAYS_SEARCH_USER_PATHS = NO; 251 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 252 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 253 | CLANG_CXX_LIBRARY = "libc++"; 254 | CLANG_WARN_CONSTANT_CONVERSION = YES; 255 | CLANG_WARN_EMPTY_BODY = YES; 256 | CLANG_WARN_ENUM_CONVERSION = YES; 257 | CLANG_WARN_INT_CONVERSION = YES; 258 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 259 | COPY_PHASE_STRIP = YES; 260 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 261 | GCC_C_LANGUAGE_STANDARD = gnu99; 262 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 263 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 264 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 265 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 266 | GCC_WARN_UNUSED_VARIABLE = YES; 267 | MACOSX_DEPLOYMENT_TARGET = 10.8; 268 | SDKROOT = macosx; 269 | }; 270 | name = Release; 271 | }; 272 | C63891801758AA400005069A /* Debug */ = { 273 | isa = XCBuildConfiguration; 274 | buildSettings = { 275 | COMBINE_HIDPI_IMAGES = YES; 276 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 277 | GCC_PREFIX_HEADER = "RegexKitLiteDebugger/RegexKitLiteDebugger-Prefix.pch"; 278 | INFOPLIST_FILE = "RegexKitLiteDebugger/RegexKitLiteDebugger-Info.plist"; 279 | PRODUCT_NAME = "$(TARGET_NAME)"; 280 | WRAPPER_EXTENSION = app; 281 | }; 282 | name = Debug; 283 | }; 284 | C63891811758AA400005069A /* Release */ = { 285 | isa = XCBuildConfiguration; 286 | buildSettings = { 287 | COMBINE_HIDPI_IMAGES = YES; 288 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 289 | GCC_PREFIX_HEADER = "RegexKitLiteDebugger/RegexKitLiteDebugger-Prefix.pch"; 290 | INFOPLIST_FILE = "RegexKitLiteDebugger/RegexKitLiteDebugger-Info.plist"; 291 | PRODUCT_NAME = "$(TARGET_NAME)"; 292 | WRAPPER_EXTENSION = app; 293 | }; 294 | name = Release; 295 | }; 296 | /* End XCBuildConfiguration section */ 297 | 298 | /* Begin XCConfigurationList section */ 299 | C638915D1758AA400005069A /* Build configuration list for PBXProject "RegexKitLiteDebugger" */ = { 300 | isa = XCConfigurationList; 301 | buildConfigurations = ( 302 | C638917D1758AA400005069A /* Debug */, 303 | C638917E1758AA400005069A /* Release */, 304 | ); 305 | defaultConfigurationIsVisible = 0; 306 | defaultConfigurationName = Release; 307 | }; 308 | C638917F1758AA400005069A /* Build configuration list for PBXNativeTarget "RegexKitLiteDebugger" */ = { 309 | isa = XCConfigurationList; 310 | buildConfigurations = ( 311 | C63891801758AA400005069A /* Debug */, 312 | C63891811758AA400005069A /* Release */, 313 | ); 314 | defaultConfigurationIsVisible = 0; 315 | }; 316 | /* End XCConfigurationList section */ 317 | }; 318 | rootObject = C638915A1758AA400005069A /* Project object */; 319 | } 320 | -------------------------------------------------------------------------------- /RegexKitLiteDebugger/RegexKitLite.h: -------------------------------------------------------------------------------- 1 | // 2 | // RegexKitLite.h 3 | // http://regexkit.sourceforge.net/ 4 | // Licensed under the terms of the BSD License, as specified below. 5 | // 6 | 7 | /* 8 | Copyright (c) 2008-2010, John Engelhart 9 | 10 | All rights reserved. 11 | 12 | Redistribution and use in source and binary forms, with or without 13 | modification, are permitted provided that the following conditions are met: 14 | 15 | * Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above copyright 19 | notice, this list of conditions and the following disclaimer in the 20 | documentation and/or other materials provided with the distribution. 21 | 22 | * Neither the name of the Zang Industries nor the names of its 23 | contributors may be used to endorse or promote products derived from 24 | this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 32 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 33 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 34 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 35 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | */ 38 | 39 | #ifdef __OBJC__ 40 | #import 41 | #import 42 | #import 43 | #import 44 | #import 45 | #endif // __OBJC__ 46 | 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | 53 | #ifdef __cplusplus 54 | extern "C" { 55 | #endif 56 | 57 | #ifndef REGEXKITLITE_VERSION_DEFINED 58 | #define REGEXKITLITE_VERSION_DEFINED 59 | 60 | #define _RKL__STRINGIFY(b) #b 61 | #define _RKL_STRINGIFY(a) _RKL__STRINGIFY(a) 62 | #define _RKL_JOIN_VERSION(a,b) _RKL_STRINGIFY(a##.##b) 63 | #define _RKL_VERSION_STRING(a,b) _RKL_JOIN_VERSION(a,b) 64 | 65 | #define REGEXKITLITE_VERSION_MAJOR 4 66 | #define REGEXKITLITE_VERSION_MINOR 0 67 | 68 | #define REGEXKITLITE_VERSION_CSTRING _RKL_VERSION_STRING(REGEXKITLITE_VERSION_MAJOR, REGEXKITLITE_VERSION_MINOR) 69 | #define REGEXKITLITE_VERSION_NSSTRING @REGEXKITLITE_VERSION_CSTRING 70 | 71 | #endif // REGEXKITLITE_VERSION_DEFINED 72 | 73 | #if !defined(RKL_BLOCKS) && defined(NS_BLOCKS_AVAILABLE) && (NS_BLOCKS_AVAILABLE == 1) 74 | #define RKL_BLOCKS 1 75 | #endif 76 | 77 | #if defined(RKL_BLOCKS) && (RKL_BLOCKS == 1) 78 | #define _RKL_BLOCKS_ENABLED 1 79 | #endif // defined(RKL_BLOCKS) && (RKL_BLOCKS == 1) 80 | 81 | #if defined(_RKL_BLOCKS_ENABLED) && !defined(__BLOCKS__) 82 | #warning RegexKitLite support for Blocks is enabled, but __BLOCKS__ is not defined. This compiler may not support Blocks, in which case the behavior is undefined. This will probably cause numerous compiler errors. 83 | #endif // defined(_RKL_BLOCKS_ENABLED) && !defined(__BLOCKS__) 84 | 85 | // For Mac OS X < 10.5. 86 | #ifndef NSINTEGER_DEFINED 87 | #define NSINTEGER_DEFINED 88 | #if defined(__LP64__) || defined(NS_BUILD_32_LIKE_64) 89 | typedef long NSInteger; 90 | typedef unsigned long NSUInteger; 91 | #define NSIntegerMin LONG_MIN 92 | #define NSIntegerMax LONG_MAX 93 | #define NSUIntegerMax ULONG_MAX 94 | #else // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64) 95 | typedef int NSInteger; 96 | typedef unsigned int NSUInteger; 97 | #define NSIntegerMin INT_MIN 98 | #define NSIntegerMax INT_MAX 99 | #define NSUIntegerMax UINT_MAX 100 | #endif // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64) 101 | #endif // NSINTEGER_DEFINED 102 | 103 | #ifndef RKLREGEXOPTIONS_DEFINED 104 | #define RKLREGEXOPTIONS_DEFINED 105 | 106 | // These must be identical to their ICU regex counterparts. See http://www.icu-project.org/userguide/regexp.html 107 | enum { 108 | RKLNoOptions = 0, 109 | RKLCaseless = 2, 110 | RKLComments = 4, 111 | RKLDotAll = 32, 112 | RKLMultiline = 8, 113 | RKLUnicodeWordBoundaries = 256 114 | }; 115 | typedef uint32_t RKLRegexOptions; // This must be identical to the ICU 'flags' argument type. 116 | 117 | #endif // RKLREGEXOPTIONS_DEFINED 118 | 119 | #ifndef RKLREGEXENUMERATIONOPTIONS_DEFINED 120 | #define RKLREGEXENUMERATIONOPTIONS_DEFINED 121 | 122 | enum { 123 | RKLRegexEnumerationNoOptions = 0UL, 124 | RKLRegexEnumerationCapturedStringsNotRequired = 1UL << 9, 125 | RKLRegexEnumerationReleaseStringReturnedByReplacementBlock = 1UL << 10, 126 | RKLRegexEnumerationFastCapturedStringsXXX = 1UL << 11, 127 | }; 128 | typedef NSUInteger RKLRegexEnumerationOptions; 129 | 130 | #endif // RKLREGEXENUMERATIONOPTIONS_DEFINED 131 | 132 | #ifndef _REGEXKITLITE_H_ 133 | #define _REGEXKITLITE_H_ 134 | 135 | #if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__APPLE_CC__) && (__APPLE_CC__ >= 5465) 136 | #define RKL_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) 137 | #else 138 | #define RKL_DEPRECATED_ATTRIBUTE 139 | #endif 140 | 141 | #if defined(NS_REQUIRES_NIL_TERMINATION) 142 | #define RKL_REQUIRES_NIL_TERMINATION NS_REQUIRES_NIL_TERMINATION 143 | #else // defined(NS_REQUIRES_NIL_TERMINATION) 144 | #define RKL_REQUIRES_NIL_TERMINATION 145 | #endif // defined(NS_REQUIRES_NIL_TERMINATION) 146 | 147 | // This requires a few levels of rewriting to get the desired results. 148 | #define _RKL_CONCAT_2(c,d) c ## d 149 | #define _RKL_CONCAT(a,b) _RKL_CONCAT_2(a,b) 150 | 151 | #ifdef RKL_PREPEND_TO_METHODS 152 | #define RKL_METHOD_PREPEND(x) _RKL_CONCAT(RKL_PREPEND_TO_METHODS, x) 153 | #else // RKL_PREPEND_TO_METHODS 154 | #define RKL_METHOD_PREPEND(x) x 155 | #endif // RKL_PREPEND_TO_METHODS 156 | 157 | // If it looks like low memory notifications might be available, add code to register and respond to them. 158 | // This is (should be) harmless if it turns out that this isn't the case, since the notification that we register for, 159 | // UIApplicationDidReceiveMemoryWarningNotification, is dynamically looked up via dlsym(). 160 | #if ((defined(TARGET_OS_EMBEDDED) && (TARGET_OS_EMBEDDED != 0)) || (defined(TARGET_OS_IPHONE) && (TARGET_OS_IPHONE != 0))) && (!defined(RKL_REGISTER_FOR_IPHONE_LOWMEM_NOTIFICATIONS) || (RKL_REGISTER_FOR_IPHONE_LOWMEM_NOTIFICATIONS != 0)) 161 | #define RKL_REGISTER_FOR_IPHONE_LOWMEM_NOTIFICATIONS 1 162 | #endif 163 | 164 | #ifdef __OBJC__ 165 | 166 | // NSException exception name. 167 | extern NSString * const RKLICURegexException; 168 | 169 | // NSError error domains and user info keys. 170 | extern NSString * const RKLICURegexErrorDomain; 171 | 172 | extern NSString * const RKLICURegexEnumerationOptionsErrorKey; 173 | extern NSString * const RKLICURegexErrorCodeErrorKey; 174 | extern NSString * const RKLICURegexErrorNameErrorKey; 175 | extern NSString * const RKLICURegexLineErrorKey; 176 | extern NSString * const RKLICURegexOffsetErrorKey; 177 | extern NSString * const RKLICURegexPreContextErrorKey; 178 | extern NSString * const RKLICURegexPostContextErrorKey; 179 | extern NSString * const RKLICURegexRegexErrorKey; 180 | extern NSString * const RKLICURegexRegexOptionsErrorKey; 181 | extern NSString * const RKLICURegexReplacedCountErrorKey; 182 | extern NSString * const RKLICURegexReplacedStringErrorKey; 183 | extern NSString * const RKLICURegexReplacementStringErrorKey; 184 | extern NSString * const RKLICURegexSubjectRangeErrorKey; 185 | extern NSString * const RKLICURegexSubjectStringErrorKey; 186 | 187 | @interface NSString (RegexKitLiteAdditions) 188 | 189 | + (void)RKL_METHOD_PREPEND(clearStringCache); 190 | 191 | // Although these are marked as deprecated, a bug in GCC prevents a warning from being issues for + class methods. Filed bug with Apple, #6736857. 192 | + (NSInteger)RKL_METHOD_PREPEND(captureCountForRegex):(NSString *)regex RKL_DEPRECATED_ATTRIBUTE; 193 | + (NSInteger)RKL_METHOD_PREPEND(captureCountForRegex):(NSString *)regex options:(RKLRegexOptions)options error:(NSError **)error RKL_DEPRECATED_ATTRIBUTE; 194 | 195 | - (NSArray *)RKL_METHOD_PREPEND(componentsSeparatedByRegex):(NSString *)regex; 196 | - (NSArray *)RKL_METHOD_PREPEND(componentsSeparatedByRegex):(NSString *)regex range:(NSRange)range; 197 | - (NSArray *)RKL_METHOD_PREPEND(componentsSeparatedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error; 198 | 199 | - (BOOL)RKL_METHOD_PREPEND(isMatchedByRegex):(NSString *)regex; 200 | - (BOOL)RKL_METHOD_PREPEND(isMatchedByRegex):(NSString *)regex inRange:(NSRange)range; 201 | - (BOOL)RKL_METHOD_PREPEND(isMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error; 202 | 203 | - (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex; 204 | - (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex capture:(NSInteger)capture; 205 | - (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex inRange:(NSRange)range; 206 | - (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range capture:(NSInteger)capture error:(NSError **)error; 207 | 208 | - (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex; 209 | - (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex capture:(NSInteger)capture; 210 | - (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex inRange:(NSRange)range; 211 | - (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range capture:(NSInteger)capture error:(NSError **)error; 212 | 213 | - (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement; 214 | - (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement range:(NSRange)searchRange; 215 | - (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement options:(RKLRegexOptions)options range:(NSRange)searchRange error:(NSError **)error; 216 | 217 | //// >= 3.0 218 | 219 | - (NSInteger)RKL_METHOD_PREPEND(captureCount); 220 | - (NSInteger)RKL_METHOD_PREPEND(captureCountWithOptions):(RKLRegexOptions)options error:(NSError **)error; 221 | 222 | - (BOOL)RKL_METHOD_PREPEND(isRegexValid); 223 | - (BOOL)RKL_METHOD_PREPEND(isRegexValidWithOptions):(RKLRegexOptions)options error:(NSError **)error; 224 | 225 | - (void)RKL_METHOD_PREPEND(flushCachedRegexData); 226 | 227 | - (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex; 228 | - (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex capture:(NSInteger)capture; 229 | - (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex range:(NSRange)range; 230 | - (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range capture:(NSInteger)capture error:(NSError **)error; 231 | 232 | 233 | - (NSArray *)RKL_METHOD_PREPEND(captureComponentsMatchedByRegex):(NSString *)regex; 234 | - (NSArray *)RKL_METHOD_PREPEND(captureComponentsMatchedByRegex):(NSString *)regex range:(NSRange)range; 235 | - (NSArray *)RKL_METHOD_PREPEND(captureComponentsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error; 236 | 237 | - (NSArray *)RKL_METHOD_PREPEND(arrayOfCaptureComponentsMatchedByRegex):(NSString *)regex; 238 | - (NSArray *)RKL_METHOD_PREPEND(arrayOfCaptureComponentsMatchedByRegex):(NSString *)regex range:(NSRange)range; 239 | - (NSArray *)RKL_METHOD_PREPEND(arrayOfCaptureComponentsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error; 240 | 241 | //// >= 4.0 242 | 243 | - (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION; 244 | - (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex range:(NSRange)range withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION; 245 | - (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION; 246 | - (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withFirstKey:(id)firstKey arguments:(va_list)varArgsList; 247 | 248 | - (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeys:(id *)keys forCaptures:(int *)captures count:(NSUInteger)count; 249 | 250 | - (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION; 251 | - (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex range:(NSRange)range withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION; 252 | - (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION; 253 | - (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withFirstKey:(id)firstKey arguments:(va_list)varArgsList; 254 | 255 | - (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeys:(id *)keys forCaptures:(int *)captures count:(NSUInteger)count; 256 | 257 | #ifdef _RKL_BLOCKS_ENABLED 258 | 259 | - (BOOL)RKL_METHOD_PREPEND(enumerateStringsMatchedByRegex):(NSString *)regex usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; 260 | - (BOOL)RKL_METHOD_PREPEND(enumerateStringsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; 261 | 262 | - (BOOL)RKL_METHOD_PREPEND(enumerateStringsSeparatedByRegex):(NSString *)regex usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; 263 | - (BOOL)RKL_METHOD_PREPEND(enumerateStringsSeparatedByRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; 264 | 265 | - (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; 266 | - (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; 267 | 268 | #endif // _RKL_BLOCKS_ENABLED 269 | 270 | @end 271 | 272 | @interface NSMutableString (RegexKitLiteAdditions) 273 | 274 | - (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement; 275 | - (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement range:(NSRange)searchRange; 276 | - (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement options:(RKLRegexOptions)options range:(NSRange)searchRange error:(NSError **)error; 277 | 278 | //// >= 4.0 279 | 280 | #ifdef _RKL_BLOCKS_ENABLED 281 | 282 | - (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; 283 | - (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; 284 | 285 | #endif // _RKL_BLOCKS_ENABLED 286 | 287 | @end 288 | 289 | #endif // __OBJC__ 290 | 291 | #endif // _REGEXKITLITE_H_ 292 | 293 | #ifdef __cplusplus 294 | } // extern "C" 295 | #endif 296 | --------------------------------------------------------------------------------