Petr Pisar wrote: >Just if you want to know my use case, the second match uses a regular >expression specified by an user. And user could assume that an empty >expression matches any string. To provide consistent semantics to the user, you need to process the user-supplied regexp, by something like $perlre = $userre eq "" ? qr/(?:)/ : qr/$userre/; or $perlre = qr/(?:$userre)/; (Compiling the regexp early with qr// is often a good idea.) -zeframThread Previous | Thread Next