[rt-devel] Fwd: RT 4.0.13 REST.pm faulty regex?

Tim Wiley tim at marchex.com
Tue Oct 29 12:03:49 EDT 2013


On 10/29/2013 08:52 AM, Gene Hsu wrote:
>
>
> ---------- Forwarded message ----------
> From: *Gene Hsu* <gene at hsufarm.com <mailto:gene at hsufarm.com>>
> Date: Tue, Oct 29, 2013 at 6:53 AM
> Subject: Re: [rt-devel] RT 4.0.13 REST.pm faulty regex?
> To: Jason Baum <jbaum-contractor at marchex.com
> <mailto:jbaum-contractor at marchex.com>>
>
>
> '-' must be at the beginning or end of a character class in order to be
> interpreted as a '-', otherwise it is interpreted as a range separator.
>
> I know nothing about the business logic around the regex, but it could
> conceivably be this:
>
> my $field = '[a-z][a-z0-9_ ~/-]*’;
>
> The error exists because '_' comes after ' ' in the character set, since
> a range is specified from lower bounds to upper bounds.
>
> -- Gene

This makes sense to me.  I'll make the change & report back.  Thank you.

>
>
>
> On Tue, Oct 29, 2013 at 12:04 AM, Jason Baum
> <jbaum-contractor at marchex.com <mailto:jbaum-contractor at marchex.com>> wrote:
>
>     Hello,
>
>     We recently upgraded from RT 3.6 to RT 4.0.13, and suddenly a couple
>     previously working Perl scripts that use the RT::Client::REST
>     convenience library (version 0.44) stopped working, and started
>     indicating an error with the regex in
>     /rt-4.0.13/lib/RT/Interface/REST.pm line 141, which in turn
>     references the $field variable defined on line 74 in that same file.
>
>     The regex defined there is as follows:
>
>     my $field = '[a-z][a-z0-9_- ~/]*’;
>
>     Perl is complaining about an “Invalid [] range “_- “ in regex” at
>     this location, which you can see follows the 9 character.
>
>     I’m wondering if anyone else has come across this problem and if
>     they have a suggested solution or knows what the correct regex
>     should be.
>
>     Thanks,
>     Jason
>
>
>



More information about the rt-devel mailing list