Is it possible from this:
US Patent 6,570,557
retrieve 3 groups being:
So far I got:
(US)(\s{1}Patent\s{1})(\d{1},\d{3},\d{3})
and was trying (?!,)
to get rid of the commas then I effectively get rid of the whole number.
Try with:
var input = 'US Patent 6,570,557',
matches = input.match(/^(\w+) (\w+) ([\d,]+)/),
code = matches[1],
name = matches[2],
numb = matches[3].replace(/,/g,'');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With