Home > Mobile >  How can I make the following RegEx pattern?
How can I make the following RegEx pattern?

Time:08-03

I need a regex pattern.

XXX[NUMBER]

For Example: XXX[123456]

or

[NUMBER]XXX

For Example: [123456]XXX

What is the pattern to match these two pattern ?

I tried the following way, but I can only add the parentheses to the beginning of the numbers:

[\[0-9]{0,35}[X]{0,35}|[X]{0,35}[\[0-9]{0,35}

Kind regards.

CodePudding user response:

If you want just the numbers with the parenthesis:

var regex = new Regex(@"\[\d \]");
  • Related