I have a string. The end is different, such as index.php?test=1&list=UL or index.php?list=UL&more=1. The one thing I\'m looking for is
index.php?test=1&list=UL
index.php?list=UL&more=1
Use:
/(&|\?)list=.*?(&|$)/
Note that when you use a bracket expression, every character within it (with some exceptions) is going to be interpreted literally. In other words, [&|$] matches the characters &, |, and $.
[&|$]
&
|
$