What does the regular expression (^ | &) on the page mean? I cannot understand the common paging functions on the Internet:
What does this regular expression mean?
$ Url_query = ereg_replace ("(^ | &) page = $ page", "", $ url_query );/
(^ | &)
This regular expression means:
^ Indicates the starting position; or [^...] indicates not;
| Yes or;
------
(^ | &) Is ^ OR & or what? In addition, the ^ symbol cannot appear in the URL. why should I replace it with ^?
Add an escape character even if you want to replace ^;
Reply to discussion (solution)
^ Indicates that the string starts.
& Represents Characters &
^ | & Indicates the start or end of a string
Your rule string is expected to match:
Page = 1
Id = 2 & page = 1
Null or &??, Followed by page ??
Http://www.example.com /? Page = 1
Http://www.example.com /? Action = list & page = 1
Use less regular expressions
Match with an empty note or an & prefix