in reply to Regexp Confuzzelemt

I'm guessing, but I think [^\?] doesn't do what you think... That means to match any one character that is not a '?'.

I would choose something simple like this:

if( $line =~ m/(?<=\#)(\w+)(?=\?\w+)/ ) {

Of course, you probably want to make sure the word characters start with caps and things...

-Paul