[Solved] Get height and length using regular expression


If you really need “1210” from “GB-1210” you can use this regular expression:

(?:\w+-|\s?x\s?)([^″]+)

Otherwise “GB-1210” can be a Chinese standard.
So probably it would be great for you to use this:

(\d+(?: \d+\/\d+)?)″

Also you can catch the measurement direction:

(\d+(?: \d+\/\d+)?)″(\w)

or

(?:\w+-|\s?x\s?)([^″]+)″(\w)

solved Get height and length using regular expression