lisali
09-27-2008, 11:23 PM
Hello,
I am trying to use Minify to dynamically minify and compress some javascripts. However, one of them causes a Fatal error, and I have pinpointed the problem to this regular expression, and I even know which symbol is causing it - but I really know nothing about Javascript, so could really use some help.
The code throwing the error is:
return Validation.get('IsEmpty').test(v) || /^[a-z0-9,!\#\$%&'\*\+/=\?\^_`\{\|}~-]+(\.[a-z0-9,!#\$%&'\*\+/=\?\^_`\{\|}~-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.([a-z]{2,})/i.test(v)
}],
And the symbol causing all the problems is the ' after the second a-z0-9, after !#\$%& and just before the \
Now - why does this work on its own, but goes crazy if I try to minify it? Can I adjust something to make it play nice?
Many thanks!
:confused::confused::confused:
Lisa
I am trying to use Minify to dynamically minify and compress some javascripts. However, one of them causes a Fatal error, and I have pinpointed the problem to this regular expression, and I even know which symbol is causing it - but I really know nothing about Javascript, so could really use some help.
The code throwing the error is:
return Validation.get('IsEmpty').test(v) || /^[a-z0-9,!\#\$%&'\*\+/=\?\^_`\{\|}~-]+(\.[a-z0-9,!#\$%&'\*\+/=\?\^_`\{\|}~-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.([a-z]{2,})/i.test(v)
}],
And the symbol causing all the problems is the ' after the second a-z0-9, after !#\$%& and just before the \
Now - why does this work on its own, but goes crazy if I try to minify it? Can I adjust something to make it play nice?
Many thanks!
:confused::confused::confused:
Lisa