[thelist] Regex Riddle

Frank Marion lists at frankmarion.com
Sat Aug 28 20:35:56 CDT 2010

On 2010-08-28, at 8:05 PM, Jason Handby wrote:
> But it's late at night, and maybe someone clever will come along and
> correct me tomorrow :-)

One day, I was approached a couple of coder friends who were having a  
friendly debate. "Frank, Mike here says that regex is an art. I say  
it's a science. Break the tie".

"Neither", I replied, "It's witchcraft".

Yes, I'll be using this with a server side language. But I'm at a loss  
as to how I'll actually implement it.

The notion is that I'll be "filtering" an entire body of html for the  
relative links.

<a href="[/\.]*index\.cfm

guarantees the relative link (it'll always be called "index.cfm"). I  
don't need to remember that. Then what I'm left with is, if it exists,  
the query string to process. Sometimes regex gives me a case of tunnel  

Thanks for the help, though. Regex is the sort of stuff that if you  
don't have Mud Mind from a long days work, you'll get one. :)

Frank Marion
lists [_at_] frankmarion.com

More information about the thelist mailing list