[Javascript] regexp - how to exclude a substring

Flavio Gomes flavio at economisa.com.br
Mon May 30 07:46:31 CDT 2005


I'd just 'substring' the result:

var result = '<div> my Div Contents </div>';
result = result.substring(5, result.length - 6);

I believe will do,

=]

-- 
Flavio Gomes
flavio at economisa.com.br


Alberto Domingo wrote:

> //
>
>Therefore as my next step I need to know how to exclude
>"</div" from the 
>
>innerHTML of the div.  I've tried (.*(<\/div){0}) but it doesn't
>seem to work.
>
> 
>
>1) How do I say "allow any number of any characters but don't allow
>this 
>
>substring"?
>
>//
>  
>
>  
>  
>  
>  
> May be an stupid idea, but, I would try to first change the substring 
> to exclude to a single special character (for example |). Then you can 
> do the regxp search excluding that special character.
>  
>  
>  
>
>
> Alberto Domingo
>
>
> _________________________________________________________________________
> Universidad de Alcalá
> Departamento de Bioquímica y Biología Molecular
> Edificio de Medicina
> Campus Universitario
> Alcalá de Henares - 28871
> Madrid
>
> Teléfono:       (+34) 91 885 4520
> FAX:            (+34) 91 885 4585
>
> alberto.domingo at uah.es




More information about the Javascript mailing list