Re: Javascript Regex to Perl Regex

2006-03-23 Thread Jay Savage
On 3/23/06, Kevin Old <[EMAIL PROTECTED]> wrote: > Here's what I have. > > # Open js file > open JSFILE, "$ARGV[0]" or die "can't open file: $ARGV[0]"; > my $js = do { local( $/ ); }; > close JSFILE; > > # Clean js > $js =~ s/^\s*function\s+(?:\w+\(\)\s*)?\s*\{\s*\n//gi; > $js =~ s/\s*}\s*$//g

RE: Javascript Regex to Perl Regex

2006-03-23 Thread Timothy Johnson
I've gotta run, but maybe this is a place to start. -Original Message- From: Kevin Old [mailto:[EMAIL PROTECTED] Sent: Thursday, March 23, 2006 11:35 AM To: Timothy Johnson Cc: Perl Beginners Subject: Re: Javascript Regex to Perl Regex Here's what I have. # Clean js $js =~ s/^\

Re: Javascript Regex to Perl Regex

2006-03-23 Thread Kevin Old
t; $fcode =~ s/^\s*function\s+(?:\w+\(\)\s*)?\s*\{\s*\n//gi; > > but I don't have any code to test it on. What do you expect to happen, > and what is really happening? > > -Original Message- > From: Kevin Old [mailto:[EMAIL PROTECTED] > Sent: Thursd

RE: Javascript Regex to Perl Regex

2006-03-23 Thread Timothy Johnson
Sent: Thursday, March 23, 2006 11:17 AM To: Perl Beginners Subject: Javascript Regex to Perl Regex Hello everyone, I have a piece of javascript that formats a chunk of javascript into a "pretty print" version of it. I'd like to have a command line version of this, but can't s

Javascript Regex to Perl Regex

2006-03-23 Thread Kevin Old
Hello everyone, I have a piece of javascript that formats a chunk of javascript into a "pretty print" version of it. I'd like to have a command line version of this, but can't seem to get the regexes to work in Perl. Just a long shot, but can anyone help with the conversion of them from JS to Pe