简体   繁体   English

如何获取匹配格式的正则表达式?

[英]How to get the regular expression matching a format?

I need to find out regular expression for the below.我需要找出下面的正则表达式。 It always starts with two characters MP, then there will be two random characters and then a number of any length.它总是以两个字符 MP 开头,然后是两个随机字符,然后是任意长度的数字。 Is there any tool I can use to generate a regular expression by providing some examples?通过提供一些示例,我可以使用任何工具来生成正则表达式吗? Thank you!谢谢!

Examples:
MPAA1234
MPXD876323
MPJH349

You could use an online regex tester to check your formula interactively :您可以使用在线正则表达式测试器以交互方式检查您的公式:

For exemple :举个例子 :

regex101.com regex101.com

Hope it helps.希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM