Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7492469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:26:46+00:00 2026-05-29T16:26:46+00:00

I am looking for removing foo parameter and its value from all the possible

  • 0

I am looking for removing foo parameter and its value from all the possible following query strings in Java.

Is there a regex pattern to do this?

http://localhost/test?foo=abc&foobar=def 
http://localhost/test?foobar=def&foo=abc
http://localhost/test?foo=abc
http://localhost/test?foobar=def&foo=abc&foobar2=def

The resulting strings would be

http://localhost/test?foobar=def 
http://localhost/test?foobar=def
http://localhost/test
http://localhost/test?foobar=def&foobar2=def
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T16:26:47+00:00Added an answer on May 29, 2026 at 4:26 pm

    This regex should match the GET param and its value…

    (?<=[?&;])foo=.*?($|[&;])
    

    RegExr.

    Just replace it with an empty string.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Removing an activity from the history stack I am looking for a
We're looking at removing all of the static resources (mainly images) in our ASP.NET
Looking for advice in removing duplication from this snippet: foreach (Car car in carList)
I am looking for best practices for creating collections made from anonymous types. There
I'm looking for some REGEX help Given the following URL: http://news.cnet.com/8301-13924_3-10315534-64.html?part=rss&subj=news&tag=2547-1_3-0-20 What is the
I'm looking to determine whether a string value from a user input (UITextField) is
Is there a idiomatic way of removing elements from PATH-like shell variables? That is
I am looking for the best known algorithm for removing duplicates from a string.
I'm looking for a convenient way to use jQuery to remove all classes from
HI All, I am desperately looking for the assistance on adding and removing the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.