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

正则表达式出错? [关闭]

Regexp :

preg_match('#^(\\w+)( | array )(\\w+)(?:|\\=(.*))$#', $line, $mtch)

Text :

integer  udg_plc = 0
integer array udg_time
string array udg_plname
player  array udg_dlforpl
multiboard udg_LastTable= null
integer array udg_kill1

As a result there is no matches. How to correct?

This is because there are more than 1 space in your input

/^(\w+)( +| +array +)(\w+)(?:| +\=(.*))$/

Use + quantifier to match 1 to many spaces

近期文章

  • 确认后如何使用checkBox clickall从表中删除所有条目? jQuery Ajax PHP
  • 内容/类型有问题:text / javascript
  • SEO友好.htaccess总是引导我到主页
  • 无法从过滤器获取值以在我的jqgrid上发布
  • too long
  • too long
  • 我可以计算并运行分页但第二页后没有显示数据?
  • 无法使用htaccess重定向到子域
  • 在twilio上使用url属性后,我需要回到调用者的角度
  • cURL保存文件并重命名?
  • php cUrl错误初始化错误
  • Laravel和数据库设计
  • 回显数组中的每个图像
  • 用于IPN的PHP自定义变量
  • Ajax PHP更新无法正常工作
  • joomla 2.5.9中的Jomsocial错误
  • 在iPhoneSDK中删除指定HTML标签
  • 使用PHP计算MongoDB中的速度太慢
  • 一页网站联系表单问题
  • 在网站上创建实时聊天框

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华