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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:12:17+00:00 2026-06-15T17:12:17+00:00

I want to make a regular expression for my university registration number. I am

  • 0

I want to make a regular expression for my university registration number. I am 75% successful to make it. I’m new and i don’t know how to make it. This is what i am doing.

<!DOCTYPE html>
<html> 
<body>

<script>
str = "l1s10bscs"; //successfully tested
                   //but i want to append any 4 digits at the end of l1s10bscs

re = /[a-zA-Z]\d{1}[s|S|f|F]\d{2}[bscs]/g;

result = re.test(str);

document.write(result);

</script>

</body>
</html>

i tried this but it doesn’t work.

re = /[a-zA-Z]\d{1}[s|S|f|F]\d{2}[bscs][0-9]{4}/g;  // this doesn't work 
  • 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-15T17:12:19+00:00Added an answer on June 15, 2026 at 5:12 pm
    /[a-z]\d[sf]\d{2}bscs\d{4}/i
    

    According to your description, this should fit.

    I changed the following:

    • [bscs] means “b or s or c or s” (so “b or s or c”, the extra s is meaningless). You wanted just the literal four-character string “bscs”
    • \d{1} is the same as \d – this isn’t an error, but there’s no reason to explicity define a character as occurring only once.
    • You have a \g flag but no \i, so you’ll match the string you’re looking for multiple times inside of a larger string, but your search isn’t case insensitive.
    • [s|S|f|F] means “s or | or S or |…” You meant “s or S or f…”, which is written [sSfF].
    • Since \i is used to make a search case insensitive, I simplified [sSfF] to [sf]
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to make regular expression to validates length of a phone number with
I'm using this regular expression to make a textbox allow a number with 6
I want to know if it is possible to make a single regular expression
I want to make regular expression that start with only 4 and 5 and
I want to make a regular expression that matches the form (+92)-(21)-1234... . I
I need to validate an Irish phone number but I don't want to make
I want to make regular expression to the following string : 2004 aston....martin db9
Possible Duplicate: Regular Expression Sanitize (PHP) I want to make my links SEO. Before
How do I make the following regular expression accept only the symbols I want
I want to make a regular expression that checks an uppercase letter in the

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.