正则表达式修复 [英] Regular Expression fixing

查看:131
本文介绍了正则表达式修复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我的正则表达式

Here is my regex below

(?<digits>\d{8})\ (?<alphabet>[x])\d{1,8}


我想评估像这样的值


and i want to evaluate values like these

00356978X7
00235791x5
00264000x2

依此类推...在运行时失败了,有人可以向我指出正确的解决方法

提前感谢
Mninawa

[edit]正则表达式重新粘贴为文本和HTML编码",以删除自动添加的结束标记-OriginalGriff [/edit]

and so on and on... when run this it fails, can someone points me to the correct direction on how to fix this

Thanx in advance
Mninawa

[edit]Regular expression re-pasted as "Text and encoded HTML" to removed auto added closing tags - OriginalGriff[/edit]

推荐答案

alphabet组的大小写更改为:
Take the space out, and make the alphabet group upper or lower case:
(?<digits>\d{8})(?<alphabet>[xX])\d{1,8}


获取 Expresso [ ^ ]-它是免费的,它可以检查并生成正则表达式.


Get a copy of Expresso[^] - it''s free, and it examines and generates Regular expressions.


这篇关于正则表达式修复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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