0

So, I have this question here, which has been answered. I'm looking to replicate the marked answer in Java. Is there any way I can do some/most/all of it in Java?

6
  • 3
    I don't know. Have you tried it yet? Commented Jan 8, 2014 at 22:29
  • 1
    Tried doing it in Java, you mean? I've been looking around for a solution, but nothing I saw does what the grep command does. Commented Jan 8, 2014 at 22:31
  • 1
    Something like this? stackoverflow.com/questions/7062954/…. That would be ideal, except that I need to capture 4 different strings as opposed to only one that the poster of that question is trying to get. Commented Jan 8, 2014 at 22:34
  • 2
    You could go with stackoverflow.com/a/13592567/1266906 Commented Jan 8, 2014 at 22:42
  • 1
    I'll give it a shot. Do you happen to know if it works with partial URLs? As you can see, the URL does not really have a "http://..." in front of it. Commented Jan 8, 2014 at 22:46

1 Answer 1

1

Of course Java can be used to replace grep as seen e.g. in this question.

As you really want extract parameter values from a URL you could e.g. go with this approach, where a simple Java-function returns all parameters and their values as a Map. If you already use a HTTP-related library you may also want to look if they included a similar function.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.