Fix a bug that causes wrong matches for regular expressions with possessive qualifier.