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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:33:50+00:00 2026-05-22T03:33:50+00:00

I am having a hard time finding a regular expression that can match these

  • 0

I am having a hard time finding a regular expression that can match these Strings:

@OSMHO:6:75
@4F0SO:5:56
@40KIR:5:15
@VDXBC:4:13
@WYRRA:6:59
@A4AUN:1118:803

As you guys can see these strings start with an ‘@’ followed by 5 alphanumeric characters, then a ‘:’, then a number, then another ‘:’, then another number.
Thanks so much for your help.

  • 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-22T03:33:51+00:00Added an answer on May 22, 2026 at 3:33 am

    To match a @ at the beginning of a pattern, use ^ (beginning of line) followed by @. So, your pattern begins with^@.

    Alphanumeric means any letter from a-z, A-Z and 0-9. When you want to represent “one of the following characters” in a regular expression the syntax is to enclose the set of characters in []. In this case it would look like [a-zA-Z0-9]. To say you want five of them you can use {5} after the set of characters. Your expression now looks like ^@[a-zA-Z0-9]{5}

    A colon is just a colon :. A multi-digit number means you want one or more digits. A digit is represented as [0-9] (ie: one of the numbers between 0 and 9). “one or more” is represented by +. So, to add a colon, one-or-more digits, a colon and one-or-more digits you would add :[0-9]+:[0-9]+. Your pattern now looks like this: ^@[a-zA-Z0-9]{5}:[0-9]+:[0-9]+.

    You can also use the shorthand \d to mean “a digit”, so you could also write^@[a-zA-Z0-9]{5}:\d+:\d+, though that can be tricky because you might need extra backslashes depending on what sort of quotes you use to define that expression. Sometimes it’s easiest to avoid shortcuts that use backslashes to make the pattern easier to understand, especially when you are first learning how to use regular expressions.

    If you want to capture each part of that match in a group, you can use parenthesis. For example, you could do ^@([a-zA-Z0-9]{5}):([0-9]+):([0-9]+) which will put the value between the @ and first : in one group, the value between the two colons in a second group, and the value after the last colon in a third group. If you only care whether you have a match or not rather than wanting each individual piece of the match you can leave the parenthesis off.

    If you build up a pattern in the way I just did — tackling one piece at a time — regular expressions can be very easy.

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

Sidebar

Related Questions

I'm having a hard time finding a good resource that explains how to use
I'm having a hard time finding py2exe recipes, especially for cases that require c
My flex sdk 4.0 is having a hard time finding these classes: import mx.automation.delegates.controls.AlertAutomationImpl;
I am having a very hard time finding a standard pattern / best practice
I'm having a hard time finding the documentation for creating a unique dependency in
i'm having a hard time finding a solution to this and am pretty sure
I am having a hard time finding this in the EXT.DomQuery Docs, so figured
I'm having a hard time finding the resources to solve my particular dilemma. I'd
Oddly I'm having a hard time finding good docs about basic error handling in
I'm having a hard time finding the solution for this for some reason --

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.