Re: String manipulation in Webcatalog

This WebDNA talk-list message is from

2001


It keeps the original formatting.
numero = 39070
interpreted = N
texte = 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 -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4720 Boston Way Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5747------------------------------------------------------------- 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)
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 -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4720 Boston Way Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5747------------------------------------------------------------- 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/ John Peacock

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:

[shownext] not displaying anything but first indices found (2000) [WebDNA] form data compared to existing database (2016) WebCat2 - many [carts] on one template page? (1997) Interface to Quickbooks (2005) Running _every_ page through WebCat ? (1997) Weird bug, or is there something amiss? (1997) Re:Emailer tracking (1997) Nav. 4 probs with cart - Serious problem (1997) WebDNA with WebStar V (2003) Sitebuilder ifs not matching [SMSI?] (2004) Performance of this mailserver (2000) PCS Frames-Default page is solution! (1997) Try not to laugh (2007) For those of you not on the WebCatalog Beta... (1997) Looking for WebCat developer/contractor (2000) Items in cart (2000) username = 115 (1999) DON'T use old cart file! (1997) Professional WebDNA Hosting Solutions (2005) WebCatalog Eating 200% of the CPU (2002)