search
Homephp教程PHP源码php 正则表达式实例详解(适合初学者)

<script>ec(2);</script>

php教程 正则表达式实例详解(适合初学者)
数学公式正则表达式:
(?'kh'()*([-+]){0,1}[0-9.]+(?'-kh'))*([+-*/]{1}(?'kh'()*((?

匹配加减乘除数学公式,如:((1+2)-3*4)

(?'kh'()*([-+]){0,1}[0-9.]+(?'-kh'))*([+-*/]{1}(?'kh'()*((? 可以"("开始,压入堆栈统计括号数量,*代表可以出现0次或多次

(?'kh'()*([-+]){0,1}[0-9.]+(?'-kh'))*([+-*/]{1}(?'kh'()*((? 可以出现一次正负号

(?'kh'()*([-+]){0,1}[0-9.]+(?'-kh'))*([+-*/]{1}(?'kh'()*((? 0-9数字,一个或多个

(?'kh'()*([-+]){0,1}[0-9.]+(?'-kh'))*([+-*/]{1}(?'kh'()*((? 可以")"结束,弹出堆栈统计括号数量,*代表可以出现0次或多次

(?'kh'()*([-+]){0,1}[0-9.]+(?'-kh'))*([+-*/]{1}(?'kh'()*((? 橙色括号分组说明可以出现一次或多次,如公式1+2 ,这个括号里是匹配 2
红色要求+-*/出现一次

(?'kh'()*([-+]){0,1}[0-9.]+(?'-kh'))*([+-*/]{1}(?'kh'()*((? 判断括号开始时,可以有正负号,?代表使用懒惰匹配,即如:1+(((2-3)+4)+5)时,只匹配数字2前面的一个括号一次

(?'kh'()*([-+]){0,1}[0-9.]+(?'-kh'))*([+-*/]{1}(?'kh'()*((? 检查括号是否配对

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools