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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:38:20+00:00 2026-06-17T09:38:20+00:00

I want to retrieve some values from a webpage using Pattern & Matcher <form

  • 0

I want to retrieve some values from a webpage using Pattern & Matcher

<form name="loginForm"  id="loginForm"  method="post" onsubmit="ScrollUp(60);return validateLoginForm();" 
                 enctype="multipart/form-data" action="/login.php">
                 <input type="hidden" name="Rpidci" value="">
                <div class="last_box">
                    <div class="second_box_heading_panel">
                        <h1>Existing users  - 
                            <span> Login here</span>
                        </h1>
                    </div>
                    <div class="second_box_form_panel">
                        <div class="error-msg">
                                                        </div>
                        <div class="name_form_panel">
                            <div class="name">User Name
                            </div>
                            <div class="name_text_field">
                                <input name="sHZnGSgdzmIJoKWOCHmYez" type="text" class="existing_user round_four" id="sHZnGSgdzmIJoKWOCHmYez" maxlength="10" value=""/>
                            </div>
                        </div>
                        <div class="name_form_panel">
                            <div class="name">Password 
                            </div>
                            <div class="name_text_field"><input name="AWrPDfe" type="password" class="existing_user round_four" id="AWrPDfe" maxlength = "20"
                            value=""/>
                            </div>
                        </div>


                              <div class="login_btn"><a href="javascript:void(0);" onclick="javascript:ScrollUp(70);return validateLoginForm();"><img src="images/login_btn.png" title="login here" /></a></div>
                            </div>
                            </div>
                      <div class="name_form_panel"></div>

                                                        </div> 

                    </div>
              </form>

I want to retrieve values of this two fields

<input name="sHZnGSgdzmIJoKWOCHmYez" type="text" class="existing_user round_four" id="sHZnGSgdzmIJoKWOCHmYez" maxlength="10" value=""/>

&

<input name="AWrPDfe" type="password" class="existing_user round_four" id="AWrPDfe" maxlength = "20" value=""/>

I tried several times but failed in getting the output. Please help.

EDIT:

The code I tried is as below: (not the same as I wrote initially as I was frustrated and messed it up very much)

Matcher matcher = Pattern.compile("<form name=\"loginForm\" .+ method=\"post\" .+ action=\"/login.php\">\\s*<input[^>]+>\\s*<input[^>]+>\\s*").matcher(loginResp);

        String[] strArr = matcher.group(0).split("<input");
        String str1 = "";
        String str2 = "";
        String str3 = "";
        String str4 = "";

        Pattern localPattern = Pattern.compile(" name=\"([^\\s]+)\" type=\"text\" id=\"([^\\s]+)\" value=\"([^\\s]+)\" />");
        Matcher localMatcher2 = localPattern.matcher(strArr[3]);
        if (localMatcher2.find()) {
            str1 = localMatcher2.group(1);
            echo("STR1 " + str1);
            str2 = localMatcher2.group(3);
            echo("STR2 " + str2);
        }
  • 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-17T09:38:20+00:00Added an answer on June 17, 2026 at 9:38 am

    As ever, I would recommend using an HTML parser such as JTidy or JSoup. You can’t do this reliably using regular expressions and an HTML parser is a much easier solution.

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

Sidebar

Related Questions

I want to retrieve some values from my url and post them in a
In Django, I'm getting some values from a select field using request.POST.getlist('tags') , so
I am using mysql and facing some problem. I want to retrieve last row
I want to serialize some information I retrieve from the user in a small
I have a HTML table as follows. I want retrieve row values from this
I'm using Linq to get some xml values, but this time I want to
I want to access a webpage programmatically and extract some information from it. I
i want retrieve route values from RouteTable, but it's null. can anybody help? public
I have the following string which i would like to retrieve some values from:
As the title says, i want to retrieve my Json data values from a

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.