Questions tagged [regexkitlite]

Lightweight Objective-C Regular Expressions for Mac OS X using the ICU Library

RegexKitLite enables easy access to regular expressions by providing a number of additions to the standard Foundation NSString class. RegexKitLite acts as a bridge between the NSString class and the regular expression engine in the International Components for Unicode, or ICU, dynamic shared library that is shipped with Mac OS X.

43 questions
34
votes
4 answers

How to check if string matches a regular expression in objective-c?

since regular exressions are not supported in Cocoa I find RegexKitLite very usefull. But all examples extract matching strings. I just want to test if a string matches a regular expression and get a Yes or No. How can I do that?
DarkLeafyGreen
  • 69,338
  • 131
  • 383
  • 601
7
votes
1 answer

How to migrate from OSSpinLock to os_unfair_lock()?

As of macOS 10.12, OSSpinLock has been deprecated. The XCode error messages urge me to use os_unfair_lock_unlock() instead. As a legacy of some open source stuff I'm relying on, I'm using RegexKitLite from 2010. How can I convert the spin lock…
Tritonal
  • 607
  • 4
  • 16
3
votes
1 answer

How do I escape special characters in an NSString using RegexKitLite?

I'm constructing a regular expression that uses strings input by the user but the strings might contain special characters such as . \ or * and I want those to be treated as literals and not interpreted by their special meanings in the regex. I've…
Mike T
  • 1,163
  • 1
  • 11
  • 27
2
votes
2 answers

The best regex to parse Twitter #hashtags and @users

Here is what I quickly came up with. It works with regexKitLite on the iPhone: #define kUserRegex @"((?:@){1}[0-9a-zA-Z_]{1,15})"; Twitter only allows letters/numbers, underscores _, and a max of 15 chars (without @). My regex seems fine but…
adrian Coye
  • 173
  • 1
  • 14
2
votes
3 answers

iPhone - Reg Exp for url validity

I have a chat view, where users can send urls to one another. In case of a url, I want to let the user press on the link and open a web view. I'm using IFTweetLabel which uses RegexKitLite. Currently the only support available is if the url starts…
Idan
  • 5,717
  • 10
  • 47
  • 84
2
votes
2 answers

Regex issue using ICU regex to find numbers not inside parentheses

I'm trying to scan a given string for a number. The number cannot be after "v/v./vol/vol.", and cannot be inside parentheses. Here's what I have: NSString *regex = @"(?i)(?
Nick Locking
  • 2,147
  • 2
  • 26
  • 42
2
votes
2 answers

RegexKitLite not matching square brackets

I'm trying to match usernames from a file. It's kind of like this: username=asd123 password123 and so on. I'm using the regular expression: username=(.*) password To get the username. But it doesn't match if the username would be say and[ers] or…
Accatyyc
  • 5,798
  • 4
  • 36
  • 51
1
vote
0 answers

RegexKitLite Runtime Crash

I'm overlaying the mapview and using RegexKitLite. I couldn't make it work. I've downloaded .m and .h files and added to the project. Also I tried, adding libicucore.dylib or libicucore.A.dlib or adding -licucore to other compiler flags field. Still…
Hasan Can Saral
  • 2,950
  • 5
  • 43
  • 78
1
vote
1 answer

RegexKit and RegexKitLite with Xcode 4 gets "Semantic Issue" errors/warnings

I am using Xcode 4.3 on Mac OS X 10.7.3. Base SDK and Deployment is OS X 10.6. When I use RegexKitLite, I get lots of compiler warnings: 'Semantic Issue' Passing 'void *volatile __strong *' to parameter of type 'void *__strong *' discards…
Harald
  • 75
  • 7
1
vote
2 answers

Regard Regex and pattern compilation in java

Please give me the code in regex for password validation in java which should consist of one Caps character,one integer ,one following symbols( @,#,$,%,^,&,+,=) and small characters. I have been trying this with different separate regular…
gauti
  • 1,264
  • 3
  • 17
  • 43
1
vote
1 answer

RegexKitLite problem with start of string

I'm trying to replace a character NOT AT THE START OF THE STRING, with itself followed by another character, using regexKitLite. thisPlate = [sBasePlate stringByReplacingOccurrencesOfRegex:[NSString stringWithFormat:@"([^\\^]%@)",…
Pete
  • 4,542
  • 9
  • 43
  • 76
1
vote
1 answer

RegexKitLite: Match Expression --> Match anything except ] --> Match ]

I am essentially attempting to replace all of the footnotes in a large text. There are various reasons I am doing this in Objective-C, so please assume that constraint. Every footnote beings with this: [Footnote Every footnote ends with this:…
Xander Dunn
  • 2,349
  • 2
  • 20
  • 32
1
vote
3 answers

Match everything that isn't a number followed by a letter

Apologies if this was answered elsewhere -- I did some searching and couldn't find the answer. Suppose I have a text file that contains a bunch of content. In that content is an occupation code, which is always in the format of a number followed by…
Travis Leleu
  • 4,190
  • 2
  • 27
  • 33
1
vote
2 answers

How to use regex to retrieve the content of attribute tag in iPhone?

I am new to iPhone development. I am using RegexkitLite framework to parse and retrieve the particular content from the Html source. I want to retrieve the content in the attribute tag. How should I give regex to achieve it? The Tag is
Warrior
  • 39,156
  • 44
  • 139
  • 214
1
vote
2 answers

How to set a single header file as C++ compiler in Xcode?

There are some C++ files in my Objective-C project. In order to use STL in header files, I set the project setting to compile source as Objective-C++ in "Build Setting". But now, I want to use RegexKitLite in my project. I found out RegexKitLite…
1
2 3