Title: Issue with javascript regex containing //
Last modified: July 19, 2018

---

# Issue with javascript regex containing //

 *  Resolved [Mircea Tihu](https://wordpress.org/support/users/sticksu/)
 * (@sticksu)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/issue-with-javascript-regex-containing/)
 * Hey,
 * There is a issue with PHP Minify when // is used in a regex – it treats it as
   a comment and it remove the rest of the line after //.
    Our specific issue is
   with “$export.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent)”, when this
   is minified the “//.test(userAgent)” is removed since it treats it as a comment.
 * The issue was reported and solved by mathiasmullie: [https://github.com/matthiasmullie/minify/commit/a85f804092715b0d221c281272df742f55e660f0](https://github.com/matthiasmullie/minify/commit/a85f804092715b0d221c281272df742f55e660f0)
 * Could you please update the version of PHP Minify used in the plugin?
 * Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Raul P.](https://wordpress.org/support/users/alignak/)
 * (@alignak)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/issue-with-javascript-regex-containing/#post-10612882)
 * Hello,
 * Thank you for this.
 * Last time we updated PHP Minify there were other errors that followed suit… but
   I’ll take a look and release it soon.
 *  Thread Starter [Mircea Tihu](https://wordpress.org/support/users/sticksu/)
 * (@sticksu)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/issue-with-javascript-regex-containing/#post-10634758)
 * Hey,
 * If there are issues with the latest PHP Minify there’s no need to update it altogether,
   all there’s needed is a small patch for the regex at line 245 here: [https://github.com/matthiasmullie/minify/commit/a85f804092715b0d221c281272df742f55e660f0](https://github.com/matthiasmullie/minify/commit/a85f804092715b0d221c281272df742f55e660f0)
 * We modified that line in your plugin to test it and everything else works fine.
 * Thanks.
 *  Plugin Author [Raul P.](https://wordpress.org/support/users/alignak/)
 * (@alignak)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/issue-with-javascript-regex-containing/#post-10647569)
 * [@sticksu](https://wordpress.org/support/users/sticksu/) I updated PHP Minify
   from 2.3.5 [2018.08.27] onwards from master. Thanks

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Issue with javascript regex containing //’ is closed to new replies.

 * ![](https://ps.w.org/fast-velocity-minify/assets/icon-128x128.jpg?rev=1440946)
 * [Fast Velocity Minify](https://wordpress.org/plugins/fast-velocity-minify/)
 * [Support Threads](https://wordpress.org/support/plugin/fast-velocity-minify/)
 * [Active Topics](https://wordpress.org/support/plugin/fast-velocity-minify/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/fast-velocity-minify/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/fast-velocity-minify/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Raul P.](https://wordpress.org/support/users/alignak/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/issue-with-javascript-regex-containing/#post-10647569)
 * Status: resolved