regexkitlite

RegexKitLite assertion failure occurring intermittently.

I'm using the wonderful RegexKitLite framework built upon the ICU library that ships with Mac OS X and iPhone OS. It has been smooth sailing so far, with the exception of this error that appears intermittently when searching for matches: Internal Error Invalid parameter not satisfying: (cacheSlot->setToHash == buffer->hash) && (cacheSlo...

RegExKitLite matching HTML tags and extracting text

how uo use RegExKitLite matching HTML tags and extracting text ? ie: <li color=red> <span>1</span> <span>2</span> </li> how to get content between <li> </li> ? ...

How to use regex to retrive 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 <a href="http://www.stackoverflow.com" class="11-link-dkred-bold">This is stack overflow HTML</a> I want...

How to make RegexKitLite w/ iPhone SDK produce a list of all matches +/- and also return surrounding text.

I'd like to create a regular expression that will match and return based on the following criteria: 1) I have N search terms entered by a user 2) I have a body of text. 3) I want to return a list of all the occurrences of all the search terms entered by the user plus surrounding context. I think (\w+\W+){,4}(", ")(\W+\w+){,4} might w...

Regular Expression doesn't match

Hi All, I've got a regular expression in my cocoa-touch app (using RegexKitLite). NSString *week = [[NSString alloc] initWithFormat:@"%@", [pageContent stringByReplacingOccurrencesOfRegex:@"<select name=\"week\" class=\"selectbox\" style='width:134' onChange=\"doDisplayTimetable(NavBar, topDir);\">(.+?)<option value=\"(.+?)\">(.+?)...

Regular Expression doesn't match

Hi All, I've got a string with very unclean HTML. Before I parse it, I want to convert this: <TABLE><TR><TD width="33%" nowrap=1><font size="1" face="Arial"> NE </font> </TD> <TD width="33%" nowrap=1><font size="1" face="Arial"> DEK </font> </TD> <TD width="33%" nowrap=1><font size="1" face="Arial"> 143 </font> </TD> </TR></TABLE> in...

Objective C - RegexKitLite - Parsing inner contents of a string, ie: start(.*?)end

Please consider the following: NSString *myText = @"mary had a little lamb"; NSString *regexString = @"mary(.*?)little"; for(NSString *match in [myText captureComponentsMatchedByRegex:regexString]){ NSLog(@"%@",match); } This will output to the console two things: 1) "mary had a little" 2) "had a" What I want is just the 2nd bit ...

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 a capital letter. How can I extract ONLY the occ codes from the file? In plain english...

RegexKitLite issue

Hi folks, I installed RegexKitLite and everything functioning well, except there are many "analyzer results" about potential leaks when compiling the app. These warning are from the RegexKitLite.m Do I missing something during the installation? thanks ...

Match several times in RegexKitLite

I'm trying to get some info out of a document. I'm trying to match the info I need with regex, which matches 3 numbers within a string. It works fine, but it only matches the first occurance. I need it to match an unlimited number of times because I don't know how many times this string will occur. NSString *regex = @"String containing ...

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 similar. It won't match the brackets. Any solution for this? ...

RegexKitLite replacement pattern changing case of found match

I'd like to change the case (ie, lowercase to uppercase) of found matches using RegexKitLite but don't know how or if it's possible. In PCRE regex, you can have in the replacement pattern something like \u$1 to uppercase the found match of group 1. I can't see how to do that. Can someone please let me know how? Thanks in advance ...

Find URL inside NSString (BBCode) using RegexKitLite

HI, I have a NSString that cotains a lot of text. Inside the text is a iTunes URL. The URL is masked with BBCode. How can I extract the plain URL? Sorry, but my regex skills are really bad. The text: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam ...

RegexKitLite replace url with html link

This isn't working for some reason it just crashes my app: NSString *urlRegex = @"\\bhttps?://[a-zA-Z0-9\\-.]+(?:(?:/[a-zA-Z0-9\\-._?,'+\\&%$=~*!():@\\\\]*)+)?"; NSString *urlParsedStatus = [status stringByReplacingOccurrencesOfRegex:urlRegex withString:@"<a href=\"$1\">$1</a>"]; NSLog(@"new string: %@", urlParsedStatus); any idea...

regexkitlite match ?

Hi, i would like to get everything inbetween &amp;v= and "> using a regex expression, NSString *YouTubeRegex = @"/amp;v=([^(\">)]+)/"; But that regex is not returning any matches ? i know the coding is correct just not the regex expression any help ? Thanks ...