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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:27:39+00:00 2026-05-26T00:27:39+00:00

Everyone, I’ve been try to solve this since yesterday. What is the representation of

  • 0

Everyone, I’ve been try to solve this since yesterday.

What is the representation of pattern that contain (A-Z)* and (\\p{Punct})* and (0-9)* and (\\s), and all char of the pattern were Uppercase.

i.e,

  • PATTERN {001}

  • OTHERS PATTERN (002-005)

edit :
just moment ago, i got this patter for question above:

(([A-Z])*|(\\p{Punct})*|([0-9])*|(\\s)*)*

the new problem is getting the uppercase sub String from some String which separated with “|”:

then, I used code look like below :

            String theString = "";
            String theUppercase = "";
            Pattern level5Patter = Pattern.compile("(([A-Z])*|(\\p{Punct})*|([0-9])*|(\\s)*)*\\|");
            Matcher level5Matcher = level5Patter.matcher(strFileContent);
            while(level5Matcher.find()){
                String resultLevel5 = level5Matcher.group();
                if(resultLevel5.toUpperCase().equals(resultLevel5)){
                    System.out.println(resultLevel5);
                }
                else{
                    theString=theString+resultLevel5;
                }
            }

the sub string will look like below :

TITLE OF THIS DATA IS ALWAYS UPPERCASE AND SOMETIME CONTAIN NUMERIC 1.0.0.0.0 EVEN PUNCTUATION {}

The String source is look like below:

Head 1|Head 1.0|Head 1.0.0|Head 1.0.0.0|TITLE OF THIS DATA IS ALWAYS UPPERCASE AND SOMETIME CONTAIN NUMERIC 1.0.0.0.0 EVEN PUNCTUATION {}|first data description sometime contains UPPERCASE and numeric 1010 and punctuation {}|01234|Head 1|Head 1.0|Head 1.0.0|Head 1.0.0.1|TITLE OF THIS DATA IS ALWAYS UPPERCASE AND SOMETIME CONTAIN NUMERIC 1.0.0.1.0 EVEN PUNCTUATION|first data description sometime contains UPPERCASE and numeric 1010 and punctuation {}|56789|

Thanks in advance.

  • 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-26T00:27:40+00:00Added an answer on May 26, 2026 at 12:27 am

    Create a character class and put everything in, that you want to allow

    Pattern p = Pattern.compile("^[A-Z0-9\\p{P}\\s]+$");
    

    [A-Z0-9\\p{P}\\s] this is a character class, that allows A-Z, 0-9, Punctuation and Whitespace.

    ^ is an anchor for the start of the string

    $ is an anchor for the end of the string

    + is a quantifier that allows

    A more unicode approach would be

    ^[\\p{Lu}\\p{N}\\p{P}\\s]+$
    

    \\p{Lu} an uppercase letter that has a lowercase variant.

    \\p{N} any kind of numeric character in any script.

    See here on regular-expressions.info for more information

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

Sidebar

Related Questions

everyone! new to here and been pondering about this myself for some times with
everyone! I've been at this for a while, and I'm not sure how this
Everyone on this site has been very helpful on my schooling of iOS programming,
Everyone knows that this is not thread safe: public StringBuilder Builder { get {
everyone. This is a piece of code from using sqlite in android tutorial: return
everyone! I try to update values in .resx file with ResXResourceWriter and the value
everyone. I know this is a far treated subject, but I've looked everywhere and
Everyone, I am a newbie to android development. Now I have a question that
everyone. Here is a small VBA (Excel) function that i wrote, full of MsgBoxes
everyone, I've started working yesterday on the Euler Project in Clojure and 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.