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 &list=
.
How can I match it, whether it's in the middle of the string or it's at the end? So far I've got [&|?]list=.*?([&|$])
, but the ([&|$])
part doesn't actually work; I'm trying to use that to match either &
or the end of the string, but the end of the string part doesn't work, so this pattern matches the second example but not the first.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…