Paul,
  Thank you! That worked great. 

--- In [email protected], "Paul Whitelock" <[EMAIL PROTECTED]> wrote:
>
> How about this:
> 
> var pattern:RegExp = new RegExp("(<.*?>)|(</.*?>)", "g");
> text = text.replace(pattern, "");
> 
> Paul
> 
> ---
> Paul Whitelock
> Denver, Colorado
> 
> 
> > > -----Original Message-----
> > > From: [email protected] 
> > > [mailto:[EMAIL PROTECTED] On Behalf Of e_baggg
> > > Sent: Thursday, December 21, 2006 2:57 PM
> > > To: [email protected]
> > > Subject: [flexcoders] Re: RegExp
> > > 
> > > Parker,
> > > Thanks, but that did not do the trick. It still returned the 
> > > full HTML. yes, you are right though...that first back slash 
> > > was not needed. Hmm, back to the drawing board I guess. It 
> > > stinks, I found a regular expression that does what I need 
> > > but it does not compile in AS3. I'll keep hammering the books 
> > > and tutorials to try and figure this out. newbies to regex 
> > > and deadlines don't mix well.
> > > 
> > > --- In [email protected] 
> > > <mailto:flexcoders%40yahoogroups.com> , "parkerwhirlow"
> > > <thunder.stumpges+yahoo@> wrote:
> > > >
> > > > a couple quick things.. I'm by no means an expert at regex...
but...
> > > > 
> > > > the first backslash is unnecessary isn't it? & is not a meta 
> > > > character, so the \ after the first / isn't needed. also,
don't you 
> > > > want to remove ALL characters between the < and > ? so I'd 
> > > change the 
> > > > inner [a-zA-Z0-9]* to .*? (the question mark makes it a lazy 
> > > > quantifier instead of an agressive quantifier)
> > > > 
> > > > And one last thing, is you may need the multi-line flag 
> > > also (if the 
> > > > XML has line breaks... so I'd give this a shot... haven't
tried it 
> > > > myself though....
> > > > 
> > > > /&lt;.*?&gt;/gim
> > > > 
> > > > good luck
> > > > PW
> > > > 
> > > > --- In [email protected] 
> > > <mailto:flexcoders%40yahoogroups.com> , "e_baggg" <e_baggg@> wrote:
> > > > >
> > > > > I am trying to create a regular expression that 
> > > essentially parses 
> > > > > out all the html of a text string. (i.e. - Remove all 
> > > text between "&lt;"
> > > > > and "&gt;"). I am not the seasoned regex pro, but my 
> > > attempts have 
> > > > > failed based on research within the livedocs:
> > > > > 
> > > > > var pattern : RegExp = /\&lt;[a-zA-Z0-9]*&gt;/gi
> > > > > 
> > > > > Does anyone see what is wrong?
> > > > > 
> > > > > var stringToEdit : String = "&lt;!DOCTYPE html PUBLIC 
> > > '-//W3C//DTD 
> > > > > HTML 4.01 
> > > Transitional//EN'&gt;&lt;html&gt;&lt;head&gt;text I should 
> > > > > see&lt;/head&gt;&lt;/html&gt;";
> > > > > 
> > > > > var pattern : RegExp = /\&lt;[a-zA-Z0-9]*&gt;/gi var 
> > > newStr : String 
> > > > > = stringToEdit.replace(pattern, ""); trace(newStr);
> > > > > 
> > > > > //Desired Output:
> > > > > text I should see
> > > > > 
> > > > > //Actual output :-(
> > > > > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 
> > > > > Transitional//EN"><html><head>text I should see</head></html>
> > > > >
> > > >
> > > 
> > > 
> > > 
> > >  
> > >
> >
>


Reply via email to