这个字符集是什么意思[\ + -x\ *] [英] What does this character set mean [\+-x\*]

查看:111
本文介绍了这个字符集是什么意思[\ + -x\ *]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个正则表达式几乎可以匹配任何角色。我对正则表达式中的'x'特别好奇。

this regex seems to match almost any character. I am particularly curious about the 'x' in the regex.

推荐答案

看看这里:正则表达式语言 - 快速参考 [ ^ ]

正则表达式基本语法参考 [ ^ ]
Have a look here: Regular Expression Language - Quick Reference[^]
Regular Expression Basic Syntax Reference[^]


连字符是关键部分,正则表达式是匹配+到x范围内的任何字符或*



例如 )和z不匹配



不确定为什么不只是[\ * -x]说实话。
The hyphen is the key part, the regex is saying match any character in the range "+" to "x" or *

For example ")" and "z" would not match

Not sure why it isn't just [\*-x] to be honest.


这篇关于这个字符集是什么意思[\ + -x\ *]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆