Brian - It's a regular expression. It says, "find a part of the string that starts with 'pcode=' and is followed by 0 or many characters that are you & which could be followed by anthing else.
How's that? Mike Wokasch UW-Extension At 09:06 AM 9/26/2002 -0500, you wrote: >Ben, > >I've seen answers like this to other questions as well. I have never quite >understood what is taking place. Do you mind spending a couple of minutes to >explain what ".*pcode=([^&]+).*", "\1" does? > > >Thanks, > >Brian Yager >President - North AL Cold Fusion Users Group >http://www.nacfug.com >Sr. Systems Analyst >Sverdrup/CIC >[EMAIL PROTECTED] >(256) 842-8342 > > >-----Original Message----- >From: Ben Doom [mailto:[EMAIL PROTECTED]] >Sent: Wednesday, September 25, 2002 4:54 PM >To: CF-Talk >Subject: RE: please do my work for me > > >I'm assuming this is a link somewhere in some content you're cfhttp-ing, or >you'd just use url.pCode. > >Anyhow, >pcode = rereplacenocase(url, ".*pcode=([^&]+).*", "\1") > >Happy regexing. > > > > --Ben Doom > Programmer & General Lackey > Moonbow Software > >: -----Original Message----- >: From: Cantrell, Adam [mailto:[EMAIL PROTECTED]] >: Sent: Wednesday, September 25, 2002 5:38 PM >: To: CF-Talk >: Subject: please do my work for me >: >: >: I want to extract a value from a URL variable which can show up >: anywhere in >: the URL. Here are some examples, I would want the pCode value which will >: always be an integer of varying length: >: >: index.htm?var1=23&pCode=100&othervar=hello -------- return 100 >: >: index.htm?pCode=1 ------- return 1 >: >: index.htm?someVariabl=hiThere&someothervariable=45&pCode=00343223234322 >: --------- return 00343223234322 >: >: If somebody can tell me the right regular expression (or if a regular >: expression isn't even needed, but just some combination of CF functions) >: that would be GREAT! >: >: Adam. >: >: > > ______________________________________________________________________ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists