[thelist] simple .NET regex problem

Anthony Baratta anthony at baratta.com
Wed Jun 27 22:06:36 CDT 2007


Because I'm a glutton for punishment...here is an improved regex that 
only returns the target text area:

     (?<=(text%3D'))(.[^']*)(?=')

     [0] run-on sentence


Anthony Baratta wrote:
> Here ya go....
> 
> text%3D'(.[^']*)'
> 
> This will return:
> 
>     [0]  text%3D'run-on sentence'
> 
>     [1] run-on sentence
> 
> Hope that helps.
> 
> -----Original message-----
> From: Scott Dexter dexilalolai at yahoo.com
> Date: Wed, 27 Jun 2007 09:18:58 -0700
> To: evolt thelist at lists.evolt.org
> Subject: [thelist] simple .NET regex problem
> 
>> Hi kids (been a while, no?)
>>
>> I'm trying to do some simple regexing, and I'm stumped. A sample string:
>>
>> [KEYWORD text%3D'run-on sentence' word%3D'run-on sentence' definition%3D'two or more sentences that are written together and are separated by a comma or no mark of punctuation at all']
>>
>> I'm trying to get the quoted text after the "text%3D", and for some reason, I can't get it to work. I would guess something like \[KEYWORD text%3D'(.*)' would do the trick, but it appears the word 'text' is causing problems? Halp?
>>
>> sgd




More information about the thelist mailing list