Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

Correct way to set a variable using regular expressions?

 

 

Apache users RSS feed   Index | Next | Previous | View Threaded


rschmid at raptor

May 11, 2012, 9:16 AM

Post #1 of 1 (86 views)
Permalink
Correct way to set a variable using regular expressions?

I am upgrading from Apache 2.2 to 2.4. In one of my pages I had the following;

<!--#if expr="$DOCUMENT_URI == /^\/([a-zA-Z0-9\-_]*)\..*$/" -->
<!--#set var="PAGEID" value="$1" -->
<!--#endif -->

This doesn't work in 2.4 unless I enable SSILegacyExprParser which I can do but I'd like to figure out how to upgrade the pages.

I've gotten as far as;

<If "%{DOCUMENT_URI} =~ /^\/([a-zA-Z0-9\-_]*)\..*$/">
<!--#set var="PAGEID" value="$1" -->
</If>


This is where I'm stuck. It appears that the back reference $1 is not stored as it was before but I can't figure out how to access the back references. Is this simply the wrong way to do this now? What is the right way?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd

Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.