Re: String manipulation in Webcatalog

This WebDNA talk-list message is from

2001


It keeps the original formatting.
numero = 39074
interpreted = N
texte = try wrapping [likenumber] inside [math][likenumber][/math]like: [text]num=00000234567[/text] with 0=[num] without 0=[math][num][/math]works for me.on 10/4/01 8:04 AM, John Peacock at jpeacock@rowman.com wrote:> Laeg Ent. wrote: >> >> [grep >> search=0+([0-9]+)0+&replace=\1][likenumber][/grep] >> >> this just gets rid of the initial zeros...... >> >> 0010200 results in 10200 >> > > Sorry, the ([0-9]+) is too greedy (snagging all trailing zeros). If > you were using Perl, you could use this instead: > > [grep search=0+([0-9]+?)0+&replace=\1][likenumber][/grep] > > which would be the nongreedy version of 1 or more. In this case, you > will have to pick off the initial zeros then strip the trailing > zeros. Do this to strip the trailing zeros: > > [grep search=([1-9]+)0+$&replace=\1][likenumber][/grep] > > which is to say find any sequence numbers that do not include 0 and > are followed to the end of line by only zeros and replace it by just > the number. > > John ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: String manipulation in Webcatalog (Marc M. 2001)
  2. Re: String manipulation in Webcatalog (Marc M. 2001)
  3. Re: String manipulation in Webcatalog (John Peacock 2001)
  4. Re: String manipulation in Webcatalog (Brian Fries 2001)
  5. Re: String manipulation in Webcatalog (Laeg Ent. 2001)
  6. Re: String manipulation in Webcatalog (Laeg Ent. 2001)
  7. Re: String manipulation in Webcatalog (Laeg Ent. 2001)
  8. Re: String manipulation in Webcatalog (Anup Setty 2001)
  9. Re: String manipulation in Webcatalog (John Peacock 2001)
  10. Re: String manipulation in Webcatalog (Anup Setty 2001)
  11. String manipulation in Webcatalog (Laeg Ent. 2001)
try wrapping [likenumber] inside [math][likenumber][/math]like: [text]num=00000234567[/text] with 0=[num] without 0=[math][num][/math]works for me.on 10/4/01 8:04 AM, John Peacock at jpeacock@rowman.com wrote:> Laeg Ent. wrote: >> >> [grep >> search=0+([0-9]+)0+&replace=\1][likenumber][/grep] >> >> this just gets rid of the initial zeros...... >> >> 0010200 results in 10200 >> > > Sorry, the ([0-9]+) is too greedy (snagging all trailing zeros). If > you were using Perl, you could use this instead: > > [grep search=0+([0-9]+?)0+&replace=\1][likenumber][/grep] > > which would be the nongreedy version of 1 or more. In this case, you > will have to pick off the initial zeros then strip the trailing > zeros. Do this to strip the trailing zeros: > > [grep search=([1-9]+)0+$&replace=\1][likenumber][/grep] > > which is to say find any sequence numbers that do not include 0 and > are followed to the end of line by only zeros and replace it by just > the number. > > John ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Marc M.

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

simple answer? [hideif] (1997) Sense/Disallow HTML tags during $Append (1997) Caching pages...again (2001) [ipaddress] (2003) [WebDNA] [createdate] displays today's date on Ubuntu 14.04 / WebDNA Server 8.? (2014) UK credit card info follow-up (1997) Num Found by category (2000) BadSuffix with 2.1b3 cgi (1997) FW: 2.01 upgrade problems (1997) New public beta available (1997) Associative lookup style? + bit more (1997) Non-WebDNA Sites Reporting Errors When WebDNA Isn't Running (2006) Help name our technology! I found it (1997) [ShowIf] if the varieable exists (1998) Claris HomePage messes up the code (1997) [WebDNA] version 7.1 on ubuntu apache2 virtual host config (2014) Email security (was CC and Europe) (1999) select multiple (1997) Country & Ship-to address & other fields ? (1997) Emailer (WebCat2) (1997)