Re: How do I specify a & character in Grep?
This WebDNA talk-list message is from 2000
It keeps the original formatting.
numero = 34131
interpreted = N
texte = >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 Consultant808-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/
Associated Messages, from the most recent to the oldest:
>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 Consultant808-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/
Kenneth Grome
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:
SiteEdit Pro Update Announcement (1997)
[protect] (1998)
with Link i need to (1997)
math on date? (1997)
Strange search... (2000)
Problems with Price field (1997)
PCS Frames (1997)
Merging databases (1997)
[ShowNext] feature in 2.0 (1997)
Running 2 two WebCatalog.acgi's (1996)
Issue with plug-in Webcat, webstar 4.x, SSL and IE when using the backbuttom (2000)
Max Record length restated as maybe bug (1997)
Encrypt File (2006)
Same Database needed on two machines (2002)
Looking for a special Image Upload Script (2004)
RAM variables (1997)
embedded showif statements (2000)
Searching an Email database (1997)
Migrating 4.0.2 to 4.5 (2002)
Decrypting a user password (2000)