我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何匹配非引用的东西?

I have the following RegEx to remove commentary from a PHP file: %/\*.*?\*/%s

The side effect is, that on use of glob like glob($basedir . '/*') it starts removing everything midcode...

So how do I tell the regex to not match when there are quotes in front of it or behind it?

Try this :

%[^'"]{1}/\*.*?\*/[^'"]{1}%s

It include not simple or double quote before /* and after */

近期文章

  • jQuery UI链式选择菜单。 单击按钮时表单重置
  • Preg_match从XML中的所有URL中删除跟踪代码
  • 如何在symfony2中安装EventDispatcher
  • Localhost facebook登录不适用于较低级别的URL
  • http.responseText返回名为的PHP函数的名称
  • 无法通过Shopify API帖子创建自定义产品集合
  • 使用redirect_uri Shopify OAuth身份验证将返回invalid_request
  • IMAP - 编码UTF-8
  • cakephp $ this-> User-> save($ this-> data)错误记录用户的编辑功能
  • 使用<a>链接而不是select /选项将选定值传递给PHP表单
  • MySQL远程访问麻烦?
  • 如何在mysql_query返回的数组中找到一些值
  • FEDEX运费率API错误消息:'找不到帐号。'
  • 检索wordpress页面的原始URL
  • 从Android应用访问Wordpress数据?
  • Youtube API订阅者计数不更新
  • 使用PHP文件源的JQuery UI自动完成
  • mySql多列连接与重合数据
  • php回显大块数据
  • 使用php动态生成列表中的页面

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华