- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2024 08:59 AM
I need the input to begin with 'IT' followed by 25 characters.
When I tested IT60X0542811101000000123456 for regex ^IT\[0-9A-Z]{25}$, no matches were detected.
What might be the reason?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2024 10:32 PM
Hi @tsoct
Can you please try with the below regex :
^IT[A-Z0-9]{25}$
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2024 09:20 AM - edited 05-09-2024 09:22 AM
Hopefully this should work /^IT\d[0-9 A-Z]+.{0,25}$/g
Please mark this as helpful and accept it as a solution if this resolves your query.
Thanks,
Sujatha V.M.
Sujatha V.M.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2024 09:57 AM
Thanks, but this accepts less than 25 too. It must be 25 exact characters
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2024 09:48 PM
@tsoct Please find my scenarios based on your inputs:
You have mentioned it should hold 25 characters after the word "IT"
Syntax : /\d([^a-z]){25}$/g
Test String : IT12345678912345678912345678
Your Test String : IT60X0542811101000000123456
Scenario 1 : Limit to 25
Length is 25, so its matched
Length is less than 25 so its not matched
Scenario 2: Ignore Lowercase
By adding a uppercase character or digit, it matches the expression
If its a lowercase, it doesn't match the expression
Please try and let me know the results. Also modify accordingly to your need.
Please mark this as helpful and accept it as a solution if this resolves your query.
Thanks,
Sujatha V.M.
Sujatha V.M.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2024 09:14 AM
^IT.{25}$ assuming you want to allow any character (excluding line terminations)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2024 09:16 AM
It must be Uppercase and digits only. No special character allowed