in reply to Re: can I make my regexp match first pattern instead of last?
in thread can I make my regex match first pattern instead of last?

Awesome! Thanks for the answer! This seems to work fine. I had to modify your suggested regex a bit to handle matching both the item and the catalog number, since that was part of my original problem. I may not have made that very clear above.

My regex looks like this, and it's acting on the whole $block variable instead of acting on just the first line of each block.

m/ELEMENT\s(.+?)\s\(Item := \"\Q$item\E\".+?CatalogNumber := \"\Q$catNum\E/s

Thanks again for the quick help!