My GNU Octave version is 4.0.0 In 4.0.x versions, the output of print_usage is like this: -- Mapping Function: abs (Z) That's why the regexp works. You can see an example in: https://octave.org/doc/v4.0.0/Raising-Errors.html#Raising-Errors Looking at the doc sources, it looks like the output was the same in GNU Octave 3. Now, after 4.0.x, namely 4.2.x, it seems that the output has changed to what you see, and an example can be seen here: https://octave.org/doc/v4.2.0/Raising-Errors.html#Raising-Errors