So.. i have this regex /(%)((?:[a-z][a-z0-9_]*))/ I'm not sure if it's correct but anyway what i'm trying to do is use it to get a line of text from a webpage that begins with a % character and ends in a whitespace so it would be like: whatever %Get_This123 whatever

Whether or not the grep function is useful, depends on how you want to process the result. A more frequently used solution is, however, to loop through the file and apply your regex to each line.

Note that the pattern matching operator in Perl is =~

(See perldoc perlop)

BTW, your regexp doesn't fulfil the condition "ends in a whitespace", because the word string might also be terminated, for instance, by a dot, comma, or uppercase letter (for this reason, your example string ".... %Get_This123 ..." would not match).