I’ve some pages with this URL
folder/t_01_class.shtml
with a sequential number
folder/t_02_class.shtml
folder/t_03_class.shtml
folder/t_10_class.shtml
folder/t_11_class.shtml
folder/t_12_class.shtml
folder/t_23_class.shtml
and I need to get variable with regex that don’t considers first zero so the result should be
<!--#set var="page" value="2"-->
<!--#set var="page" value="3"-->
<!--#set var="page" value="10"-->
<!--#set var="page" value="11"-->
<!--#set var="page" value="12"-->
<!--#set var="page" value="23"-->
any suggestion
Thanks
If the regex is acting against the entire page name requested in the URL, I’d suggest using something along the lines of
/t_0*([1-9]\d*)_/and then retrieving numbered group 1.To clarify that regex:
//around each end are delimiters signifying the regex itself, they are not an active part of the matching.t_will match the beginning of the page0*will match any leading 0’s[1-9]\d*will match any number starting in 1-9, and 0 or more subsequent digits (\dis the equivalent of[0-9], and*after\dmeans “0 or more”)()around the bit above will make this a numbered group, allowing you to retrieve the match_at the end is to ensure that the number match is complete