Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #18088

Re: Need regexp help

Newsgroups comp.lang.javascript
Subject Re: Need regexp help
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <eed9c2f1-0e66-4502-849d-9d538eddd1a8@googlegroups.com>
Date 2013-01-12 09:25 +0100
Message-ID <XnsA1465FDD94A88eejj99@194.109.133.133> (permalink)

Show all headers | View raw


justaguy wrote on 12 jan 2013 in comp.lang.javascript:

> Hi,
> 
> How could use regexp (replace) to find all occurences of the following
> CSS code in a long string and remove them?   Thanks.

Lacking your definition of "css-code", I will presume that is anything 
between { and }, stipulating those characters don't appear elsewhere in 
your string.

Without that stipulation your Q is unanswerable, 
as css-code is just normal text.

> <xmp>
> body { font-family : "Courier New", Courier, monospace; font-size :
> 9pt; valign : top; text-align : left; line-height: 9pt } 
> 
> td {
> font-family : "Courier New", Courier, monospace; font-size : 9pt;
> valign : top; text-align : left; line-height: 9pt } </xmp>

s = s.replace( /{[}]+}/g , '{}' );

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Need regexp help justaguy <lichunshen84@gmail.com> - 2013-01-11 17:01 -0800
  Re: Need regexp help Richard Yates <richard@yatesguitar.com> - 2013-01-11 17:14 -0800
    Re: Need regexp help Richard Yates <richard@yatesguitar.com> - 2013-01-11 21:00 -0800
      Re: Need regexp help Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-01-12 16:16 +0100
        Re: Need regexp help "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-01-12 16:27 +0100
        Re: Need regexp help Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-01-13 00:49 +0100
  Re: Need regexp help Luc Yen <luc@goal.tw> - 2013-01-11 22:10 -0800
  Re: Need regexp help "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-01-12 09:25 +0100
    Re: Need regexp help justaguy <lichunshen84@gmail.com> - 2013-01-12 06:33 -0800
  Re: Need regexp help justaguy <lichunshen84@gmail.com> - 2013-01-12 10:22 -0800
    Re: Need regexp help justaguy <lichunshen84@gmail.com> - 2013-01-12 10:48 -0800
      Re: Need regexp help SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2013-01-13 22:02 +0100
    Re: Need regexp help "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-01-12 23:11 +0100

csiph-web