Regular Expressions help

Joshua McKinney clug at bitfed.com
Mon Dec 9 22:27:52 EST 2002


On Mon, Dec 09, 2002 at 10:20:56PM +1100, Alex Satrapa wrote:
> Joel Pearson wrote:
> 
> > Just say I have this data “<option value=IMD> (IMDEX LIMITED) IMD”, 
> > normally what happen is it pulls out IMB and IMDEX LIMITED.
> >
> What's the thing after the brackets? If it's always a short string, and 
> never has brackets, you might want to try:
> 
> "/value=(.{3})> \((.+)\)[^)]+$/"
> 
> That is, match everything from the first bracket after the 
> angle-bracket, to the last bracket before the end of the line.
> 
> HTH
> 
> 
also wouldn't
 "/value=(...)> \((.+)\)[^)]+$/"
 be easier to read

-- 
If I can't fix it, it aint broke.



More information about the linux mailing list