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 8616971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:44:46+00:00 2026-06-12T05:44:46+00:00

<a href=$handler$&landing_url=https://foo.com/index.html> <img src=https://foo.com/images/08_180x80.gif border=0 alt=> </a> I have this code which I need

  • 0
 <a href="$handler$&landing_url=https://foo.com/index.html">
  <img src="https://foo.com/images/08_180x80.gif" border="0" alt="">
</a>

I have this code which I need to return to calling service. However, while returning, i need to replace $handler$ with something i get from props file. Which is easy.

hard part is :

I need to get the landing_url , encrypt it, also add more info to it.

How can i parse this fragment into pieces ?

or is there an easier way to do it?

  • 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-06-12T05:44:47+00:00Added an answer on June 12, 2026 at 5:44 am

    This is the regex you need: /<a href=\".*?landing_url=(.*?)\">/.

    Putting all the code together:

    public static void main(String[] args) {
        String str = "<a href=\"$handler$&landing_url=https://foo.com/index.html\">";
        String regex = "<a href=\".*?landing_url=(.*?)\">";
        List<String> parts = evaluate(regex, str);
        System.out.println("landing_url: " + parts.get(0));
    }
    
    public static List<String> evaluate(String regex, String line) {
        List<String> result = new ArrayList<String>();
        Pattern pattern = Pattern.compile(regex);
    
        int count = 1;
        Matcher matcher = pattern.matcher(line);
        while (matcher.find()) {
            result.add(matcher.group(count++));
        }
        return result;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 3 links on page index.php: <div id=languages> <a href=index.php?page=test&lang=en id=flag> <img src=./images/flags/en.png
Our site contains href links to various subdomains: foo.mysite.com, bar.mysite.com. For testing purposes, I'd
Let's say I am getting requests such as: http://www.example.com/index.php?id=123&version=3&id=234&version=4 Is it possible to extract
I have an href in HTML that I dynamically produce from a server. I
I have a generic ajax Error handler written like so: $('html').ajaxError(function(e, xhr, settings, exception)
I have a click handler that reads the href attribute of an a tag
i have a link with a click handler here. the href is filled with
I have the following snippet which works as expected: <a href=http://google.com onclick=return false;>Will go
A the end of my index.html file I'm including two script files. One of
I have a simple click handler that will alert its link's href as in:

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.