#!/usr/bin/perl -w use strict; use Parse::RandGen::Regexp; my $regexp = "/^STOR\s[^\n]{100}/smi"; my $r = Parse::RandGen::Regexp->new($regexp); my $string = $r->pick(match=>1, captures=>{}); print("\$string: $string\n"); #### Unrecognized escape \s passed through at ./regexp2.pl line 6. %Error: Parse::RandGen::Regexp has an element that is not a Regexp reference (ref="")! at /usr/lib/perl5/site_perl/5.8.6/Parse/RandGen/Regexp.pm line 36 Parse::RandGen::Regexp::_newDerived('Parse::RandGen::Regexp=HASH(0x9dcdd88)', 'HASH(0x9e5f138)') called at /usr/lib/perl5/site_perl/5.8.6/Parse/RandGen/Condition.pm line 81 Parse::RandGen::Condition::new('Parse::RandGen::Regexp', '/^STORs[^\x{a}]{100}/smi') called at ./regexp2.pl line 7 #### "/^STOR\s[^\n]{100}/smi"; #### qr/^STOR\s[^\n]{100}/smi