1

I have the following Strings:

abc 12x15x2x99 31x15x29 zzz
ppp 12x52x2x69 24x05x59 mmm
12x55x2x99 2x05x90
12x55x2x99 20x05x71 zzz
pppppp 12x55x2x17 21x55x99 
21x4x23
eee 24x45x49 mmmm

In each row I want to find match for NNxNNxNN where NN can be one number or two numbers

I look for a string that not start and end with x and has the form NNxNNxNN

I wrote the following RegEx, but it doesn't find the required match :

.*[^x]?([0-9]{1,2}x[0-9]{1,2}x[0-9]{1,2}[^x]).*

How can I tell it to not expect the symbol x at the beginning of the match?

Nir
  • 601
  • 7
  • 21

0 Answers0