Re: [WebDNA] Quick grep question
This WebDNA talk-list message is from 2009
It keeps the original formatting.
numero = 103381
interpreted = N
texte = Marc Thompson wrote:> This works too and is a bit shorter, but I like Donovan's better.> > [math][countwords delimiter=%20][T_words][/countwords]-1[/math]> > That's the beauty of WebDNA, there's more than one way to skin a cat.> (Not that I would ever do that!)> > Marc> > Donovan Brooke wrote:>> Patrick McCormick wrote:>>> Does anyone have a quick [grep] to count the number of spaces in a string?>>>> Patrick!, Start hitting "compose" or "new post" when posting a *new* >> post!! ;-)>>>>>> [countchars][grep search=[^ ]&replace=][T_words][/grep][/countchars]>>>>>> DonovanI love a good community cat skinning session... ;-)Unfortunately, WebDNA's delimiter param (in both listwords and countwords) does not work in quite the way you want it to.For example, the above will fail in:[text]T_words=this is a string of text with spaces. Now to count them[/text](which contains multiple spaces between "string" and "of".)Donovan-- Donovan BrookeWebDNA Software Corporationhttp://www.webdna.us**[Square Bracket Utopia]**
Associated Messages, from the most recent to the oldest:
Marc Thompson wrote:> This works too and is a bit shorter, but I like Donovan's better.> >
[math][countwords delimiter=%20][T_words][/countwords]-1[/math]> > That's the beauty of WebDNA, there's more than one way to skin a cat.> (Not that I would ever do that!)> > Marc> > Donovan Brooke wrote:>> Patrick McCormick wrote:>>> Does anyone have a quick
[grep] to count the number of spaces in a string?>>>> Patrick!, Start hitting "compose" or "new post" when posting a *new* >> post!! ;-)>>>>>>
[countchars][grep search=[^ ]&replace=][T_words][/grep][/countchars]>>>>>> DonovanI love a good community cat skinning session... ;-)Unfortunately, WebDNA's delimiter param (in both listwords and countwords) does not work in quite the way you want it to.For example, the above will fail in:
[text]T_words=this is a string of text with spaces. Now to count them[/text](which contains multiple spaces between "string" and "of".)Donovan-- Donovan BrookeWebDNA Software Corporationhttp://www.webdna.us**[Square Bracket Utopia]**
Donovan Brooke
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:
RAM variables (1997)
Too many lines too add in one go (2003)
changing prices in cart (1997)
[WebDNA] plupload ? (2012)
Serious bug writing to a database ... (2002)
Running 2 two WebCatalog.acgi's (1996)
hidden databases (2000)
find with exceptions (1997)
using showpage and showcart commands (1996)
WebCat2 - Getting to the browser's username/password data (1997)
Database changes (1998)
Checking for @ sign (2006)
[WebDNA] Windows WebDNA Editor (2009)
can WC render sites out? (1997)
Exclamation point (1997)
AD Error Msg (1997)
Hello??? (1997)
Extended [ConvertChars] (1997)
emailer settings and control questions (1997)
Members register & gain access system (1998)