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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:03:32+00:00 2026-05-28T17:03:32+00:00

I am in my first few days of Regular Expression learning. I am trying

  • 0

I am in my first few days of Regular Expression learning. I am trying to do a simple pattern match to find an occurrence of @@@XXX@@@ markers in my log file where XXX is an uppercase word with no spaces/numeric values allowed there (underscore allowed too). There can be no or multiple spaces between starting &&& and the actual word or the word and the terminating&&&. XXX is always Upper case and no spaces/numeric values allowed there (underscore is allowed).

Some allowed examples:
@@@CAT@@@

@@@ CAT@@@

@@@ CAT @@@

@@@ CAT_DOG @@@

I tried doing something like:

Pattern pattern = Pattern.compile("\\@{3}(\\s* \\w \\s*)\\@{3}");

Doesn’t it mean check for 3 instances of @ followed by o to n instances of space followed by a word followed again by o to n instances of space followed by 3 instances of @ ?
It captures the cases with @@ but does not capture where more than 3 @ are used.
How do I specify there are 3 and only 3 instances of @? ….And obviously I still have not plugged the uppercase restriction.

  • 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-28T17:03:33+00:00Added an answer on May 28, 2026 at 5:03 pm

    Try this:

    "(^|[^@])@{3}\s*[_A-Z]+\s*@{3}($|[^@])"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I started learning rails a few days ago and I'm reading head first rails
I already work a few days at a first glance at the simple task
I am using OpenSearchServer v1.2.4 rc3. In the first few days it's working fine.
I have a big problem since a few days that I can't solve. First
Last few days I'm trying to start with farseer library, however i just can't
I'm completely new to jQuery. To be honest it is my first few days.
A few days ago I started with Ubuntu for the first time. I want
Im being a few days struggling to create my first Security realm in glassfish
For a few days, I have been trying to get the username to save
So been a few days now learning about web references within my projects I

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.