Tokey is a configurable, general-purpose code tokenizer that supports comment and string skipping. When you need to find specific structures in a code block (such as imports in JavaScript, or URLs in CSS) and you don't want to use a full-blown parser, you can create a specific tokenizer to get the job done.
Read more about the core package here.