You could just find the first head, store the position, find the next head, store the position, and then just use mid(string,pos+6,pos-1) to strip the middle out....
maybe there is a more efficient way.... Brook At 11:32 PM 08/11/01 +0000, you wrote: >The code I'm doing now is actually in JS, but I'm having a >general CF/JS regular expression learning binge, and I've hit >a brick wall - can anyone help?! > >Best example of the problem is this: > >string = string.replace(/<HEAD[^>]*>[^(<\/HEAD>)]*<\/HEAD>/gi,''); > >I want this to strip any <HEAD> tags - and *anything* in >between them. The middle bit is the problem - how do I >match "zero or more characters up to the point where you >find </HEAD>"? Putting </HEAD> in parentheses and negating >it with a carat seems to only work if there are no characters >between in tags that appear in "</HEAD>". So > ><HEAD>12345678</HEAD> > >will be stripped out fine, but > ><HEAD>1234567d</HEAD> > >gets left in. I know I must be just missing one control character, >or have one in the wrong spot, but no reference material I've >got seems to point it out. Anyone got any hints? > >cheers, > >- Gyrus > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists