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 \]");