0

I would recieve text like below CRM NO: 23542536 crmno:@ 3542536 crmno:_ 3542536... crm no 43653768754 my desired output will be: 23542536 3542536 3542536 43653768754 I want to write a regex to extract only the number after the string 'CRM NO'.

Also the CRM NO will come in variations like CRM NO or crmno or crm no

I have tried the regex ((?<=CRM NO)\D+\d+) but not compatible with all the entries

1 Answers1

0

You can use a capture group with a case insensitive match and then match the leading part with an optional space

(?i)\bCRM ?NO\D+(\d+)\b

Regex demo

The fourth bird
  • 154,723
  • 16
  • 55
  • 70