只分离这个表达式中的手机号码。

huangapple go评论56阅读模式
英文:

how i can seperate only mobile number from this expression in notepad ++

问题

"GET /mspProducerM/sendSMS?user=userjesus&pwd=jcallshttp&sender=JCALLS&mobile9159525910&msg=Promise%20for%20Jan,%2002%20The%20Lord%20blesses%20His%20people%20with%20peace.-%20Psalm%2029:11.%20For%20Prayers%20and%20Queries%20call%20044-45999000&mt=0" 中的文本中提取了 "9159525910"。

英文:
103.199.145.50 - - [02/Jan/2020:04:42:34 +0530]
"GET /mspProducerM/sendSMS?user=userjesus&pwd=jcallshttp&sender=JCALLS&mobile9159525910&msg=Promise%20for%20Jan,%2002%20The%20Lord%20blesses%20His%20people%20with%20peace.-%20Psalm%2029:11.%20For%20Prayers%20and%20Queries%20call%20044-45999000&mt=0 
HTTP/1.1" 200 42

like i need to extract text, 9159525910

答案1

得分: 0

你可以尝试以下的查找和替换,在启用 DOT ALL 模式的情况下使用正则表达式:

查找:\b\d+.\d+.\d+.\d+ - - [[^]]+].?".?\bmobile=(\d+).*?" \d+ \d+
替换:$1

Demo

这里的方法是匹配输入的整行,然后捕获手机号码。替换部分只是捕获的电话号码。

英文:

You may try the following find and replace, in regex mode, with DOT ALL enabled:

Find:   \b\d+\.\d+\.\d+\.\d+ - - \[[^]]+\].*?".*?\bmobile=(\d+).*?" \d+ \d+
Replace: $1

<h2>Demo</h2>

The approach here is to match the entire line of your input, and then capture the mobile number. The replacement is just the captured phone number.

huangapple
  • 本文由 发表于 2020年1月3日 13:24:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/59573577.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定