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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:29:23+00:00 2026-05-29T10:29:23+00:00

I have a html input element from which I need to extract the name

  • 0

I have a html input element from which I need to extract the name and value using two separate regex (Java).

<INPUT type="hidden" id="Region" value="Circuits Japan" checked="false">

I need to extract Region and Circuits Japan from above using 2 different regex.

For id extraction, I used something like this .*id=(.[^"]+) and it gives me

Region value=Circuits Japan checked=false>

whereas I’m trying to extract only “Region”.
Any inputs will be much appreciated.

Cheers:-)

  • 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-29T10:29:23+00:00Added an answer on May 29, 2026 at 10:29 am

    First of all: parsing attributes of html using a single regex is hard to do, because order of attributes can vary.
    If you want to do multiple passes it’s not that hard.
    Given that you don’t have " then the regex for id would be:

    id=(\\S+)

    Of course you can’t parse multiple word attributes like that. You will need " just to properly represent such attributes. Assuming you have multiword attribute with " around then you should use:

    someAttribute=\\"([^"]+)

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

Sidebar

Related Questions

I have an HTML form generated by JSF which maps an input element to
I have this HTML code for radios: <input type='radio' name='a_27' value='Yes' id='a_27_0' /> <input
I have a html element (like select box input field) in a table. Now
I have an HTML input box <input type=text id=foo value=bar> I've attached a handler
I have a simple form with some plain html input like bellow using ASP.NET
I have below html code in my aspx. <input type=hidden id=medicalLink value='<a href=/forms/contactus.aspx >Contact
I have this HTML dropdown: <form> <input type=text id=realtxt onkeyup=searchSel()> <select id=select name=basic-combo size=1>
I have got a return from a server which is a block of html,
I have two select lists which are being styled using the jQuery UI Selectmenu
Im trying to call a js function on a HTML element which I have

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.