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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:14:58+00:00 2026-06-09T09:14:58+00:00

How can I extract the value of the bookid from this string using Java?

  • 0

How can I extract the value of the bookid from this string using Java?

href="http://www.books.com/?bookname=cooking&bookid=12345678&bookprice=123.45">cooking book
  • 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-09T09:15:00+00:00Added an answer on June 9, 2026 at 9:15 am

    Normally you should use some parser but if your String is really this short then maybe regular expression can be option like

    String s="href=\"http://www.books.com/?bookname=cooking&bookid=12345678&bookprice=123.45\">cooking book";
    Pattern p= Pattern.compile("(?<=bookid=)\\d+");
    Matcher m=p.matcher(s);
    if (m.find())
        System.out.println(m.group());
    

    output:

    12345678

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

Sidebar

Related Questions

I have this string: $guid = 'http://www.test.com/?p=34'; How can I extract the value of
How can i extract key value pairs from this xml example using linq: <foo>
var test = http://www.example.org/search?q=whatever&another=moretext; How can I extract another 's value ( moretext )
We can extract the mimetype from byte array, e.g., by using Apache Tika. Is
I'm looking for a parser that can extract methods from a java class (static
How can we extract a line from a multiLine EditText ? I tried this
I can extract Fixed effects from the nlme summary using summary(fm1) . But struggling
How can I extract the value between the tags (49% in message) using Javascript?
I am stumped as to how I can extract the href attribute from the
i am new to php and mysql. How can i extract a VALUE from

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.