07-24-2023, 10:13 AM
I need to extract VAT number that consists of 10 digits seperated by a dash, space or not seperated and procedeed by substring 'VAT'. VAT number never starts start with zero and is always followed by a space.
reg = new RegExp('[\d -]{10}\\s','ig');
str = ('sdfgzdfvzdfv/9/2020 VAT Invoice 16-09-2020 Citsxc zzzzw34 224- Iscvcge date 16.09.2020 VAT Terms 34 of payment: 123-456-78-90 *')
expected result: '123-456-78-90'
Thank you.
reg = new RegExp('[\d -]{10}\\s','ig');
str = ('sdfgzdfvzdfv/9/2020 VAT Invoice 16-09-2020 Citsxc zzzzw34 224- Iscvcge date 16.09.2020 VAT Terms 34 of payment: 123-456-78-90 *')
expected result: '123-456-78-90'
Thank you.