Communities for your favorite technologies. Explore all Collectives
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
String url = "mysite.com/index.php?id=12&id=432&id=145...".
i have an url with multiple parameters that have the same name "id".i want to know how to match it with java regex?
Here's a regex that will match the parameter scheme you described:
((id=\d+&?)+id=\d+[^&])
Debuggex Demo
Add a comment
This regex should catch the ids
(id=\d+&?)*
Considering that, for some URLs you may not have ids appended.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.