I was asked this question.
> I have URLs of this form.
>
http://xyz.com/xyz/page/products/Brand/Abc.html
>
> I need to extract Brand and Abc as parameters.
# script URL.txt
# Input argument - URL
var str URL
# Get the Abc.html part - it is after the last forward
# slash (/) and before the last dot.
var str page ; stex "[^.^l" $URL > null ; stex "^/^l[" $URL > $page
# Get the Brand part, it is between the last two / .
var str brand ; stex "[^/^l" $URL > null ; stex "^/^l[" $URL > $brand
# The page name and brand are now in $page and $brand.
echo $page $brand
Call the script as
script URL.txt URL("
http://xyz.com/xyz/page/products/Brand/Abc.html")
The URL argument value can also be passed to the script using
variable, expression, etc.
Richard