I am attempting to create a cursoring subroutine that will allow me to create what I call a slice navigation string.
My script allows for a "&slice=" parameter to indicate what slice to show. This works along with my "&max=" parameter to indicate how many records to show per slice.
What I will have is a $ENV{'REQUEST_URI'} whice will contain the "slice=" string in it along with a number. There are however 3 possibilities; they are:
FIRST PARAM: slice=[SOME_NUMBER]&this=that
MIDDLE-ISH PARAM: this=that&slice=[SOME_NUMBER]&that=this...
LAST PARAM: this=that&that=this&slice=[SOME_NUMBER]
What I am looking for is a regex that would create a pre and post string that would do the equivilant of (using the first example:
$pre = "slice="
$post = "&this=that"
so that I can loop and insert numbers into my new URI
slice=1&this=that
slice=2&this=that
slice=3&this=that
...
slice=100&this=that
.....
and so on, and so on. I've been trying to do this myself but have had no luck in getting a regex to address all three scenarios.
TIA
======================
Sean Shrum
http://www.shrum.net
Fixed square brackets 2002-02-27 - dvergin
In reply to Need to create a pre and post string from a REQUEST_URI by S_Shrum
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |