Skip to content
/ NSRegEx Public

Simple RegexKitLite library replacement using the NSRegularExpression class from Foundation

License

Notifications You must be signed in to change notification settings

xEsk/NSRegEx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Intro

This NSString extension has been created as a simple replacement for RegexKitLite library using the NSRegularExpression class from Foundation.

At this initital stage, this extension only covers the most common and used functions of RegexKitLite.

The idea behind this project is replace the RegexKitLite library without the necessity to change your source code written using the RegexKitLite (Only the #import should be replaced).

Current implemented functions

- (BOOL)isMatchedByRegex:(NSString *)regex;
- (BOOL)isMatchedByRegex:(NSString *)regex inRange:(NSRange)range;

- (NSString *)stringByMatching:(NSString *)regex;
- (NSString *)stringByMatching:(NSString *)regex capture:(NSInteger)capture;
- (NSString *)stringByMatching:(NSString *)regex inRange:(NSRange)range;
- (NSString *)stringByMatching:(NSString *)regex capture:(NSInteger)capture inRange:(NSRange)range;

- (NSArray *)componentsMatchedByRegex:(NSString *)regex;
- (NSArray *)componentsMatchedByRegex:(NSString *)regex capture:(NSInteger)capture;
- (NSArray *)componentsMatchedByRegex:(NSString *)regex inRange:(NSRange)range;
- (NSArray *)componentsMatchedByRegex:(NSString *)regex capture:(NSInteger)capture inRange:(NSRange)range;

- (NSArray *)arrayOfCaptureComponentsMatchedByRegex: (NSString *)regex;

- (NSString *)stringByReplacingOccurrencesOfRegex:(NSString *)regexString withString:(NSString *)replaceWithString;

External libraries

No external libraries are required.

About

Simple RegexKitLite library replacement using the NSRegularExpression class from Foundation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published