Vb.net正则表达式。 [英] Vb.net regular expression.

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

问题描述

我需要创建一个程序来获取文本文件的信息,并使用正则表达式是最好的方法。我要提取的信息有格式。

#= NUM​​BER @ = ALPHA



## @@ @ - 这是固定的,我可以这样做。

## @@@ [####] [@@] - []附带的字符是可选的,我不知道如何在其上创建正则表达式。



请帮助谢谢。 />


我尝试过:



[0-9] {2} [A-Za-z] {3} for ## @@@

I need to create a program that gets information on a text file and using regular expression is the best way to do this. The information I want to pull has a format.
# = NUMBER @ = ALPHA

##@@@ - this is fixed and I can do this.
##@@@[####][@@] - the character enclosed with [] is optional and i don't know how to create a regular expression on that.

please help thanks.

What I have tried:

[0-9]{2}[A-Za-z]{3} for ##@@@

推荐答案

阅读RegEx文档

perlre - perldoc.perl.org [ ^ ]

并使用此RegEx调试器进行试验:有一个textboc,您可以粘贴文本和你匹配的部分。

Debuggex:在线可视正则表达式测试器。 JavaScript,Python和PCRE。 [ ^ ]
Read RegEx documentation
perlre - perldoc.perl.org[^]
And use this RegEx debugger to experiment: there is a textboc where you can paste text and you which part match.
Debuggex: Online visual regex tester. JavaScript, Python, and PCRE.[^]


[^\w+([\s-_]\w+)*






试试这个



try this


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

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