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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:12:00+00:00 2026-05-30T03:12:00+00:00

I created a java phonebook (desktop app) , on my pc there’s a program

  • 0

I created a java phonebook (desktop app) , on my pc there’s a program that outputs the number of the caller. it’s an 8 digits number.

here’s how it worksenter image description here

I want to crawl only 8 digits numbers from the popup, so lets say this is a popup:

    My name is someone like you, i am 22 years old, i was born in 19/10/1989,
    my phone number is 34544512
    my brother is someone like me he is 18 years old, born in 9101993 
    his number is 07777666

in this example, i want to crawl 07777666 and 34544512 only.

I want to check the popup window every 2s for new numbers, if a caller calls me twice, his number will be already stored my db and if not I’ll store

Note: if that’s can’t be done, then forget about the popup, lets say it’s just a text being updated every 2 seconds, how to crawl it

This not a homework lol 😀

  • 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-30T03:12:01+00:00Added an answer on May 30, 2026 at 3:12 am

    Use Java regular expressions. Create a regex of 8 or more digits and use it. You will be able to extract these 2 phone numbers from your text sample.

    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    
    public class Test {
        public static void main(String args[]) throws Exception {
            String testString = "My name is someone like you, i am 22 years old, i was born in 19/10/1989,"
                              + " my phone number is  34544512 3454451266"
                              + " my brother is someone like me he is 18 years old, born in 9101993 "
                              + " his number is 07777666";
    
            String[] pieces = testString.split("\\s+");
            String expression = "\\d{8,}";
            Pattern pattern = Pattern.compile(expression);
            for (int i = 0; i < pieces.length; i++) {
                if (pattern.matches(expression, pieces[i]))
                    System.out.println(pieces[i]);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a java program that would just read a webpages code... google's for
I created a Java program that will process files using a C++ program. This
I have created a java program that shows a grid of buttons and labels
I've created a Java class that connects to an IIS website requiring NTLM authentication.
I have created a java application for Debian Linux. Now I want that that
I've created a Java EE application using a set of libraries. Works like a
Hi I have created a java application. I found there is an application menu
I created a Java code that tries to access the method LoadProject of the
I created a Java Servlet that get query result from mySQL database and print
I have created a Java desktop application and I want to run it 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.