Search code examples
regexregexkitlite

Match everything that isn't a number followed by a letter


Apologies if this was answered elsewhere -- I did some searching and couldn't find the answer.

Suppose I have a text file that contains a bunch of content. In that content is an occupation code, which is always in the format of a number followed by a capital letter.

How can I extract ONLY the occ codes from the file? In plain english, I want to remove everything in the file that does not match the number-capital_letter pattern.


Solution

  • You could match using /(\d+[A-Z])/