C$REGEXP library routine does not find the searched string when the program accepts the argument through an entry-field, if the argument is harcoded then it works ok.
The problem is that the regular expressions must be NULL-terminated because trailing spaces are allowed in regular expressions. It is necessary to use the following coding style when parsing:
INSPECT regular-expression REPLACING TRAILING SPACES BY LOW-VALUES
before to make the call to C$REGEXP library routine.