Re: [PHP] need some regex help to strip out // comments but not http:// urls

2013-05-31 Thread Tamara Temple
Tedd Sperling tedd.sperl...@gmail.com wrote: On May 29, 2013, at 5:53 PM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: Sometimes when all you know is regex, everything looks like a nail... Thanks, Ash There are people who *know* regrex? Well, not *biblically*, but yeah, I

Re: [PHP] need some regex help to strip out // comments but not http:// urls

2013-05-29 Thread Andreas Perstinger
On 28.05.2013 23:17, Daevid Vincent wrote: I'm adding some minification to our cache.class.php and am running into an edge case that is causing me grief. I want to remove all comments of the // variety, HOWEVER I don't want to remove URLs... You need a negative look behind assertion (

Re: [PHP] need some regex help to strip out // comments but not http:// urls

2013-05-29 Thread Tedd Sperling
On May 29, 2013, at 5:53 PM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: Sometimes when all you know is regex, everything looks like a nail... Thanks, Ash There are people who *know* regrex? Cheers, tedd _ tedd.sperl...@gmail.com http://sperling.com -- PHP

[PHP] need some regex help to strip out // comments but not http:// urls

2013-05-28 Thread Daevid Vincent
I'm adding some minification to our cache.class.php and am running into an edge case that is causing me grief. I want to remove all comments of the // variety, HOWEVER I don't want to remove URLs... Given some example text here with carefully crafted cases: // another comment here iframe

Re: [PHP] need some regex help to strip out // comments but not http:// urls

2013-05-28 Thread David Harkness
Hi Daevid, On Tue, May 28, 2013 at 2:17 PM, Daevid Vincent dae...@daevid.com wrote: I'm adding some minification to our cache.class.php . . . We have been using a native jsmin extension [1] which does a lot more without any trouble for over two years now. It's much faster than the equivalent

RE: [PHP] need some regex help to strip out // comments but not http:// urls

2013-05-28 Thread Daevid Vincent
From: David Harkness [mailto:davi...@highgearmedia.com] We have been using a native jsmin extension [1] which does a lot more without any trouble for over two years now. It's much faster than the equivalent PHP solution and is probably tested by a lot more people than a home-grown version.

Re: [PHP] need some regex help to strip out // comments but not http:// urls

2013-05-28 Thread David Harkness
Hi Daevid, On Tue, May 28, 2013 at 2:40 PM, Daevid Vincent dae...@daevid.com wrote: I appreciate the pointer, but our files, like many people, is a mixture of HTML, PHP and JS in one file. This jsmin appears to only work on .js files right? Also, everything else works great in our minifing

[PHP] Need some RegEx help

2001-07-19 Thread Stephan Ahonen
Okay, I've been asked to take a bunch of HTML pages and turn them into Excel spreadsheets by running them through a PHP script and outputting a semicolon-delimited text file. The pages are in this format: Name: bLAST, FIRST MIDDLE/b Pilot's Address : bADDRESS LINE 1/b