Re: How do I specify a & character in Grep?
This WebDNA talk-list message is from 2000
It keeps the original formatting.
numero = 34132
interpreted = N
texte = Thanks Ken,I want to strip out everything but the path and filename from the referrer.eg:http://www.domain.com/firstfolder/secondfolder/filename.html?blah=1&?blah2=2to end up as:/firstfolder/secondfolder/filename.htmlMy 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.ml> >Thanks, but that's not what I'm trying to do.>>>>I'm trying to strip a URL down to it's filename using Webcat's Grep.>>I'm not searching a database, I'm trying to parse some text.>>>>[grep>>search=http://[a-zA-Z_0-9]*.[a-zA-Z_0-9]*.[a-zA-Z_0-9]*/&replace=]http://www.domain.com/index.html?1st=ho&2nd=bo&3rd=mo[/grep]>>>>I want to strip out the search args of the URL string which include>>?, &, =, etc. . .>>>First you said you want to strip to the file name, then you said you>want to strip the search args. This solution does both, depending>upon what you really want, and it does not need grep to do it:>>1- Set the current URL to a text variable:>[text]theURL=http://www.domain.com/index.html?1st=ho&2nd=bo&3rd=mo[/text]>>2- Strip the search args and set the result to newURL:>[text]newURL=[middle endbefore=?][theURL][/middle][/text]>>3- Strip the newURL down to its file name:>[listwords words=[newURL]&delimiters=/][text]nameOfFile=[word][/text]>>4- To display the file name, use [nameOfFile]. To display the URL>without the search args, use [newURL].>>>================================>Kenneth Grome, WebDNA Consultant>808-737-6499 http://webdna.net>================================>>>>------------------------------------------------------------->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.comVirtual 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:
Thanks Ken,I want to strip out everything but the path and filename from the referrer.eg:http://www.domain.com/firstfolder/secondfolder/filename.html?blah=1&?blah2=2to end up as:/firstfolder/secondfolder/filename.htmlMy 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.ml> >Thanks, but that's not what I'm trying to do.>>>>I'm trying to strip a URL down to it's filename using Webcat's Grep.>>I'm not searching a database, I'm trying to parse some text.>>>>[grep>>search=http://[a-zA-Z_0-9]*.[a-zA-Z_0-9]*.[a-zA-Z_0-9]*/&replace=]http://www.domain.com/index.html?1st=ho&2nd=bo&3rd=mo[/grep]>>>>I want to strip out the search args of the URL string which include>>?, &, =, etc. . .>>>First you said you want to strip to the file name, then you said you>want to strip the search args. This solution does both, depending>upon what you really want, and it does not need grep to do it:>>1- Set the current URL to a text variable:>[text]theURL=http://www.domain.com/index.html?1st=ho&2nd=bo&3rd=mo[/text]>>2- Strip the search args and set the result to newURL:>[text]newURL=[middle endbefore=?][theURL][/middle][/text]>>3- Strip the newURL down to its file name:>[listwords words=[newURL]&delimiters=/][text]nameOfFile=[word][/text]>>4- To display the file name, use [nameOfFile]. To display the URL>without the search args, use [newURL].>>>================================>Kenneth Grome, WebDNA Consultant>808-737-6499 http://webdna.net>================================>>>>------------------------------------------------------------->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.comVirtual 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:
Why is my easy [AddLineItems] NOT working?? MORE (2000)
Verifying both name and password (was: THANKS) (1997)
unable to launch acgi in WebCat (1997)
Referrer from multiple entry points (1998)
Card clearance, problems - solutions? (1997)
[shipCost] math formula? (1997)
Webmerchant 2.1.3 startup questions, please (1999)
Grep issue (alternative method) (2003)
[WebDNA] .html suffix (2014)
BUG REPORT: numeric ge, le, gr & ls comparisons don't work ... (1999)
2nd WebCatalog2 Feature Request (1996)
OH CRAP!!!!!- Template not found error!!! (1999)
Emailer error (1998)
WebMerchant/PayFlowPro (2003)
Queertrons? (1997)
ImageMagick (2005)
Erotic Sites (1997)
Orderfile Problem (2004)
Hiding URL ? (1998)
when is date system date or order date? (1997)