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

我怎么能在php中添加“/”到preg_match?

I have this code:

preg_match("/[^-+*%0-9]+/", $your_string, $matches)

It works great but I would like to be able to add the "/" character and I don't know how.

You can use a different pattern delimiter, such as a hash, instead of a forward slash, and then just match the forward slash like any other character:

preg_match('#^/#', $subject);

Such expressions needs to escaped, so you can use it like the following:

 preg_match("/[^-+\/*%0-9]+/", $your_string, $matches)

近期文章

  • SAP化工流程行业关于回收工段能否搭建BOM的问题
  • SQL server ,考试求帮助
  • C++ 链表尾结点插入问题
  • 关于springboot操作网页不出数据
  • 爬虫运行不了,显示空白
  • 我不能不会开心的今明问题
  • 4G模块设备树该如何配置呢
  • Keil5搜索不到仿真器但是串口已连接
  • 这段存储结构如何解读
  • 是否可以获得终端宽度或打印100%宽度的填充线?
  • ADC分辨率和分辨率
  • stm32f407zgt6串口2通讯
  • SPSS只知道问卷调查的数据百分比,能做回归分析嘛
  • Python中的嵌套问题
  • ChatGPT在哪些方面提升了效率?
  • 如何避免被ChatGPT替代
  • 带有Wysiwyg字段的元数据框显示在Woocommerce单个产品自定义选项卡上
  • crm系统信息安全问题
  • css路径问题,输入url路径显示不了图片
  • 红帽rhel7系统里文件找不到是什么原因

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华