This question was asked ten years ago, so I won’t mark it as duplicate. Also I noticed no sed solution was given since OP asked an answer without:
sed -nr 's/(hello[0-9]+), please match me/\1/p' test.txt
-nstands for quiet (won’t print anything except if explicitly asked)-rallows use of extented regular expressions (avoids here using\before parenthesis)s/reg/repl/pcommand means “if regexpregmatches the current line, replace it by captured text byrepl, and prints it (/p)”