Re: grep question - removing spaces
This WebDNA talk-list message is from 2005
It keeps the original formatting.
numero = 61858
interpreted = N
texte = Here's what I use to clean up form variables passed to a page: [formvariables] [text][name]=[GetChars start=1&end=35][Grep search=[^-._@A-Za-z0-9 ]&replace=][value][/Grep][/GetChars][/text] [/formvariables]Notice the line wrap immediately following the 0-9. That is a space.MarcDale's eLists wrote:> Bill,> > ----- Original Message Follows -----> From: devaulw@onebox.com> To: "WebDNA Talk"
> Subject: Re: grep question - removing spaces> Date: Tue, 26 Apr 2005 12:41:56 -0400> > >>I don't see anything clearly wrong, but I'd try it without> > the backslashes.> > I could be wrong, but I thought I needed to escape those in> order for those to work since a dash for example defines a> range as in a-zA-z0-9 - without the backslash it doesn't> work (at least for the dash). > > It also seems the order of the \- and \_ are important as> when I had them in a different order it didn't work at all.> As currently listed, the grep will not remove embedded> spaces. I'm stumped!> > >>Bill>>>>>>-----Original Message----->>From: Dale's eLists >>Sent: Tue, 26 Apr 2005 10:44:35 -0500>>To: "WebDNA Talk" >>Subject: grep question - removing spaces>>>>Hello,>>>>I have a grep statement where I am wanting to only allow>>letters, numbers, dashes and underscores. No spaces or>>other special charactors (this will eventually be used as>>a username for email addresses).>>>>Using:>>>>[text show=t]ScreenName=[grep>>search=[^0-9a-zA-Z\-\_]&replace=][nickname][/grep][/text]>>>>if there is an embedded space, it does not get removed.>>What have I done wrong with this? >>>>Thank you!>>>>---------------------------------------------------------->>--- 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://webdna.smithmicro.com/>>>>>>>>---------------------------------------------------------->>--- 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://webdna.smithmicro.com/> > > -------------------------------------------------------------> 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://webdna.smithmicro.com/> > -- -------------------------------------------Marc ThompsonSoftware EngineerOffice of Information TechnologyUniversity of Utah801.585.9264marc.thompson@utah.edu--------------------------------------------------------------------------------------------------------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://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
Here's what I use to clean up form variables passed to a page: [formvariables] [text][name]=[GetChars start=1&end=35][Grep search=[^-._@A-Za-z0-9 ]&replace=][value][/Grep][/GetChars][/text] [/formvariables]Notice the line wrap immediately following the 0-9. That is a space.MarcDale's eLists wrote:> Bill,> > ----- Original Message Follows -----> From: devaulw@onebox.com> To: "WebDNA Talk" > Subject: Re: grep question - removing spaces> Date: Tue, 26 Apr 2005 12:41:56 -0400> > >>I don't see anything clearly wrong, but I'd try it without> > the backslashes.> > I could be wrong, but I thought I needed to escape those in> order for those to work since a dash for example defines a> range as in a-zA-z0-9 - without the backslash it doesn't> work (at least for the dash). > > It also seems the order of the \- and \_ are important as> when I had them in a different order it didn't work at all.> As currently listed, the grep will not remove embedded> spaces. I'm stumped!> > >>Bill>>>>>>-----Original Message----->>From: Dale's eLists >>Sent: Tue, 26 Apr 2005 10:44:35 -0500>>To: "WebDNA Talk" >>Subject: grep question - removing spaces>>>>Hello,>>>>I have a grep statement where I am wanting to only allow>>letters, numbers, dashes and underscores. No spaces or>>other special charactors (this will eventually be used as>>a username for email addresses).>>>>Using:>>>>[text show=t]ScreenName=[grep>>search=[^0-9a-zA-Z\-\_]&replace=][nickname][/grep][/text]>>>>if there is an embedded space, it does not get removed.>>What have I done wrong with this? >>>>Thank you!>>>>---------------------------------------------------------->>--- 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://webdna.smithmicro.com/>>>>>>>>---------------------------------------------------------->>--- 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://webdna.smithmicro.com/> > > -------------------------------------------------------------> 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://webdna.smithmicro.com/> > -- -------------------------------------------Marc ThompsonSoftware EngineerOffice of Information TechnologyUniversity of Utah801.585.9264marc.thompson@utah.edu--------------------------------------------------------------------------------------------------------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://webdna.smithmicro.com/
Marc Thompson
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:
Satisfy Me ! was: Why can't support be satisfying to purchasers? (2000)
Tracking System? (1997)
Text limits in NT version? (1997)
NT or Mac (1998)
Ruby on Rails (was Looping Search) (2006)
Nesting format tags (1997)
SiteEdit NewFile.html ? (1997)
Tax Rate (2000)
Text data with spaces in them... (1997)
Force a search at the default.tmpl page? (1997)
Cart Numbers (1997)
Moving Files (2000)
[WebDNA] [OT] WebDNA Wiki - need grammar check / (2009)
[OT] MacOs IE5 topmargin and leftmargin bug (2000)
Talk list archives down? (2003)
Toronto area? (1999)
[WebDNA] Http or Https (2009)
WebCatalog2 Feature Feedback (1996)
PCS Frames (1997)
WebMerchant 1.6 and https (1997)