I search quite a bit on google for this answer. Perhaps it is easy but in my case I did not manage to find the solution.
How to match and parse it in groups with regex service-page-name/32/54/regular/superize
I am trying to use preg_match and I would like to have
groupe 1 -> service-page-name
groupe 2 -> /32
groupe 3 -> /54
groupe 4 -> /regular
groupe 5 -> /supersize
Important obviously there is the possibility to add n numbers of parameters not just the 4 we have here in addition of the page.
Thanks
here's solution:
preg_match_all("/(\/?[\w-]+)/", $input_lines, $output_array);
you can check results of this pattern & tweak it in realtime here: https://www.phpliveregex.com/p/oD5
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.