https://adharia78@gmail.com:lat66pie@www.walmart.com/account/login
https://teresecharlene3@gmail.com:Reecewalker2431@controlboard.getcontrol.co/login
我需要
adharia78@gmail.com:lat66pie
teresecharlene3@gmail.com:Reecewalker2431
我尝试([@]*)@.*
替换$1
但不能正常工作
答案 0 :(得分:1)
https?:\/\/([^@]+).*
尝试上述正则表达式并将其替换为 $1
解释(from here):
NODE EXPLANATION
--------------------------------------------------------------------------------
http 'http'
--------------------------------------------------------------------------------
s? 's' (optional (matching the most amount
possible))
--------------------------------------------------------------------------------
: ':'
--------------------------------------------------------------------------------
\/ '/'
--------------------------------------------------------------------------------
\/ '/'
--------------------------------------------------------------------------------
( group and capture to \1:
--------------------------------------------------------------------------------
[^@]+ any character except: '@' (1 or more
times (matching the most amount
possible))
--------------------------------------------------------------------------------
) end of \1
--------------------------------------------------------------------------------
.* any character except \n (0 or more times
(matching the most amount possible))
答案 1 :(得分:0)
正则表达式查找/替换如下:
https?://([^:]+:[^@]+).*
\1
查找内容 RE搜索:
http
后跟可选s
(由于?
)://
然后我们捕获:
:
([^:]+
):
@
([^@]+
)进入\1
(将其括在括号中)
.*
)