Re: How do I specify a & character in Grep?

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 34134
interpreted = N
texte = Cool, that's the answer that I have been waiting for.I realize my example was flawed from a hurried copy and paste error, but that's because I was in a hurry to type in an example, as I have spent way too much time trying to get this to work.Firstly, grep didn't even work in the WebCatalog that I bought a week and a half ago. I was told after the fact that the syntax for what I bought is regexp not grep. . .which is not in any of the manuals or online data. In fact the online docs say that 4.0 has grep. I put a [version] tag on my page to make sure I was running 4.0. . .I was. . . Maybe it should say new in 4.1 - grep, with 4.0 being regexp.Lost a full night to that one.And then some more hours trying to get around the ampersand thing. I know Ampersand is not allowed in browser stuff, but, webcat source never gets to the browser so I thought, since it is called grep I could use the standard \ to delimit a reserved character. Who woulda thunk that I should use [url] in a grep expression.If I do use [url] to expand bad things, how do I search for [url] using grep, if that is reserved instead? Do i have to use [raw][url][raw]? Will that even work????Seems to me that \& is more to the point for a regex search expression.Thanks for the quick response on this pseudo holiday. Now I can get some work done again.ml> >http://www.domain.com/firstfolder/secondfolder/filename.html?blah=1&?blah2=2 > >This is not a proper URL -- it contains more than one question mark. >A single question mark is the delimiter between the path and the >parameters. So it's possible to parse a normal URL apart without >needing grep. > >>My question still stands. I want to know if the Grep tag is not >>true regex or is there a way to identify and use & in the grep >>expressions. >> >>It shouldn't be called grep if you can't do real regex stuff in it. >>Maybe it should be called Grep is a good name for marketing >>purposes but it isn't really the same. > >Chill, dude, this is not a conspiracy, it's just a simple syntax >question. The answer was already presented with the use of the [url] >context: embedded ampersands and other special characters in URLs are >represented as their HEX-escaped equivalents. In the case of >ampersand, the equivalent code is %26. You can automate this by >wrapping [url]...[/url] around any text which needs to be passed as a >parameter to *any* WebDNA context, not just grep. > >The general solution to any problem like this is to wrap every >parameter inside [url]: > >[grep search=[url]...some text here which may contain >ampersand...[/url]&replace=[url]...[/url]]...[/grep] > >This ensures that any 'special' characters get passed thru without >modification or misinterpretation. Ampersands as delimiters was not >our invention: it's how browsers send URLs to servers, and we >purposely chose it so as to keep things consistent for web >programmers who are already accustomed to URLs. > >Technical Support ********************************** >Smith Micro, Internet Solutions Div | eCommerce (WebCatalog) >16855 West Bernardo Drive, #380 | ------------------------- >San Diego, CA 92127 | Software & Site Development >WebCatalog Support: (858) 675-0632 | http://www.smithmicro.com > Fax: (858) 675-0372 ********************************** > >------------------------------------------------------------- >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/-- \|/ (. .) _________________________ooO_(_)_Ooo_____________________________ Mark Lacas mailto:mark@lacas.com Virtual Loft / Seattle HarborCam: http://www.loftcam.com/ SeattleStuff WebCommerce Community: http://www.seattlestuff.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://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: How do I specify a & character in Grep? (Kim Ingram 2000)
  2. Re: How do I specify a & character in Grep? (John Butler 2000)
  3. Re: How do I specify a & character in Grep? (Kim Ingram 2000)
  4. Re: How do I specify a & character in Grep? (WebDNA Support 2000)
  5. Re: How do I specify a & character in Grep? (Webcat 2000)
  6. Re: How do I specify a & character in Grep? (Webcat 2000)
  7. Re: How do I specify a & character in Grep? (WebDNA Support 2000)
  8. Re: How do I specify a & character in Grep? (Webcat 2000)
  9. Re: How do I specify a & character in Grep? (Kenneth Grome 2000)
  10. Re: How do I specify a & character in Grep? (Webcat 2000)
  11. Re: How do I specify a & character in Grep? (John Butler 2000)
  12. How do I specify a & character in Grep? (Webcat 2000)
Cool, that's the answer that I have been waiting for.I realize my example was flawed from a hurried copy and paste error, but that's because I was in a hurry to type in an example, as I have spent way too much time trying to get this to work.Firstly, grep didn't even work in the WebCatalog that I bought a week and a half ago. I was told after the fact that the syntax for what I bought is regexp not grep. . .which is not in any of the manuals or online data. In fact the online docs say that 4.0 has grep. I put a [version] tag on my page to make sure I was running 4.0. . .I was. . . Maybe it should say new in 4.1 - grep, with 4.0 being regexp.Lost a full night to that one.And then some more hours trying to get around the ampersand thing. I know Ampersand is not allowed in browser stuff, but, webcat source never gets to the browser so I thought, since it is called grep I could use the standard \ to delimit a reserved character. Who woulda thunk that I should use [url] in a grep expression.If I do use [url] to expand bad things, how do I search for [url] using grep, if that is reserved instead? Do i have to use [raw][url][raw]? Will that even work????Seems to me that \& is more to the point for a regex search expression.Thanks for the quick response on this pseudo holiday. Now I can get some work done again.ml> >http://www.domain.com/firstfolder/secondfolder/filename.html?blah=1&?blah2=2 > >This is not a proper URL -- it contains more than one question mark. >A single question mark is the delimiter between the path and the >parameters. So it's possible to parse a normal URL apart without >needing grep. > >>My question still stands. I want to know if the Grep tag is not >>true regex or is there a way to identify and use & in the grep >>expressions. >> >>It shouldn't be called grep if you can't do real regex stuff in it. >>Maybe it should be called Grep is a good name for marketing >>purposes but it isn't really the same. > >Chill, dude, this is not a conspiracy, it's just a simple syntax >question. The answer was already presented with the use of the [url] >context: embedded ampersands and other special characters in URLs are >represented as their HEX-escaped equivalents. In the case of >ampersand, the equivalent code is %26. You can automate this by >wrapping [url]...[/url] around any text which needs to be passed as a >parameter to *any* WebDNA context, not just grep. > >The general solution to any problem like this is to wrap every >parameter inside [url]: > >[grep search=[url]...some text here which may contain >ampersand...[/url]&replace=[url]...[/url]]...[/grep] > >This ensures that any 'special' characters get passed thru without >modification or misinterpretation. Ampersands as delimiters was not >our invention: it's how browsers send URLs to servers, and we >purposely chose it so as to keep things consistent for web >programmers who are already accustomed to URLs. > >Technical Support ********************************** >Smith Micro, Internet Solutions Div | eCommerce (WebCatalog) >16855 West Bernardo Drive, #380 | ------------------------- >San Diego, CA 92127 | Software & Site Development >WebCatalog Support: (858) 675-0632 | http://www.smithmicro.com > Fax: (858) 675-0372 ********************************** > >------------------------------------------------------------- >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/-- \|/ (. .) _________________________ooO_(_)_Ooo_____________________________ Mark Lacas mailto:mark@lacas.com Virtual Loft / Seattle HarborCam: http://www.loftcam.com/ SeattleStuff WebCommerce Community: http://www.seattlestuff.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://search.smithmicro.com/ Webcat

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:

HTML Editors (1997) WebCat2 as a chat server? (1997) The code, one more time. (2003) Credit card arrangement (2005) SSL problems (1998) with Link i need to (1997) Where is f2? (1997) Gary Chaison (2003) Re:trouble (1997) WebCat2b13MacPlugIn - [include] (1997) [date] insanity! (2001) Redirect frame targets (1998) presetting variables ... (2000) Can't get appendfile to work (1997) [taxRate] [TaxTotal] ? (1997) WebCatalog Upgrade Pricing? (1997) Re(8): Small Bug: ErrorLog.txt/[FORMVARIABLES]/[ORDERFILE] (1998) Multiple Pulldowns (1997) Commas in search (1998) Databases going to sleep (1998)