13,900,823 members
See more:
```Regular expression string : 101/AZ19/500000009/08
1st part : 3 digit no
2nd part : 2 char and 2 number
3rd part : 9 digit no
4th part : 2 digt no

Seprator is : /

How to write regular expression for above string? ```

What I have tried:

```Regular expression string : 101/AZ19/500000009/08
1st part : 3 digit no
2nd part : 2 char and 2 number
3rd part : 9 digit no
4th part : 2 digt no

Seprator is : /

How to write regular expression for above string?```
Posted
Updated 14-Mar-19 1:47am

## Solution 1

A digit is `\d`. A repetition can be implemented using `{N}` (meaning that a char or group must be repeated N times). With that, your regex becomes:
`^\d{3}/[A-Z]{2}\d{2}/\d{9}/\d{2}\$`
Test it here: Online regex tester and debugger: PHP, PCRE, Python, Golang and JavaScript[^]
`string regex = @"^\d{3}/[A-Z]{2}\d{2}/\d{9}/\d{2}\$";`
Note the `@` before the string; it makes the string a verbatim string literal so you don't have to escape the backslashes.
v2
Maciej Los 14-Mar-19 7:31am

5ed!
Thomas Daniels 14-Mar-19 7:32am

Thank you

## Solution 2

Just a few interesting links to help building and debugging RegEx.
Here is a link to RegEx documentation:
perlre - perldoc.perl.org[^]
Here is links to tools to help build RegEx and debug them:
.NET Regex Tester - Regex Storm[^]
Expresso Regular Expression Tool[^]
RegExr: Learn, Build, & Test RegEx[^]
Online regex tester and debugger: PHP, PCRE, Python, Golang and JavaScript[^]
This one show you the RegEx as a nice graph which is really helpful to understand what is doing a RegEx: Debuggex: Online visual regex tester. JavaScript, Python, and PCRE.[^]
This site also show the Regex in a nice graph but can't test what match the RegEx: Regexper[^]

Top Experts
Last 24hrsThis month
 OriginalGriff 310 Maciej Los 110 phil.o 100 KarstenK 75 Richard MacCutchan 75
 OriginalGriff 3,998 Richard MacCutchan 1,834 Gerry Schmitz 1,403 Maciej Los 1,330 CPallini 1,108