Re: [WebDNA] How to NOT remove the dot via grep ...
This WebDNA talk-list message is from 2009
It keeps the original formatting.
numero = 103323
interpreted = N
texte = I have no time to try but this might:[^0-9.]The a single period should just be a period inside the brackets.Outside brackets it is a wildcard for any single character.One thing about that regex is that it will leave 9.9.9 alone. You mayneed a better regex if you think you can get all kinds of crazy input.The problem is largely that WebDNA uses an irregular regex engine.There is no support for + or ranges using {x,y} for example.BillOn Wed, Aug 19, 2009 at 8:12 AM, Kenneth Grome
wrote:> Bob Minor posted some code the other day that illustrates> the use of grep to strip out all characters except for> numeric digits:>>> [grep search=3D[^0-9]&replace=3D][value][/grep]>> My goal is to do nearly the same thing, but I want to leave> the dot (.) character in the resulting value so it will be a> floating point value. =A0At first I was going to use this code:>> [listchars chars=3D[value]][showif 1234567890.^[char]][char]> [/showif][/listchars]>> ... but I think grep might be more efficient if it were> written properly. =A0I only wish I knew how.>> Does anyone know grep well enough to suggest a grep search> string that would leave not only the numeric digits but also> a decimal point in the resulting value?>> Sincerely,> Ken Grome>>>>>> ---------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> old archives: http://dev.webdna.us/TalkListArchive/> Bug Reporting: http://forum.webdna.us/eucabb.html?page=3Dtopics&category==3D288>
Associated Messages, from the most recent to the oldest:
I have no time to try but this might:[^0-9.]The a single period should just be a period inside the brackets.Outside brackets it is a wildcard for any single character.One thing about that regex is that it will leave 9.9.9 alone. You mayneed a better regex if you think you can get all kinds of crazy input.The problem is largely that WebDNA uses an irregular regex engine.There is no support for + or ranges using {x,y} for example.BillOn Wed, Aug 19, 2009 at 8:12 AM, Kenneth Grome wrote:> Bob Minor posted some code the other day that illustrates> the use of grep to strip out all characters except for> numeric digits:>>> [grep search=3D[^0-9]&replace=3D][value][/grep]>> My goal is to do nearly the same thing, but I want to leave> the dot (.) character in the resulting value so it will be a> floating point value. =A0At first I was going to use this code:>> [listchars chars=3D[value]][showif 1234567890.^[char]][char]> [/showif][/listchars]>> ... but I think grep might be more efficient if it were> written properly. =A0I only wish I knew how.>> Does anyone know grep well enough to suggest a grep search> string that would leave not only the numeric digits but also> a decimal point in the resulting value?>> Sincerely,> Ken Grome>>>>>> ---------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> old archives: http://dev.webdna.us/TalkListArchive/> Bug Reporting: http://forum.webdna.us/eucabb.html?page=3Dtopics&category==3D288>
William DeVaul
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:
[ConvertChars] problem (1997)
Redirect (2000)
WebCat and HTML/OS (2001)
WebCat2b13MacPlugIn - [include] doesn't allow creator (1997)
PIXO (1997)
Separate SSL Server (1997)
Secure Web Server (1999)
Is the Finder required? (1998)
RE: Price recalc based on quantity (1997)
Sorry WebDNA server not running (2002)
WebCat2b13 Command Reference Doc error (1997)
Webcat/Webmerchant part II (1998)
MATH PROBLEM (1997)
[WebDNA] Still having problems (2008)
RE: Switching To NT (1999)
encrypt/decrypt password with authenticate (2002)
Installed 4.5 but indicates 4.50rc2 (2002)
OT: Just for a waste of time (2003)
SV: Mass Mail (2000)
FW: Shipping calculations (1997)