Regex: how to separate username:password? I need a code to separate in 2 diferrent lists usernames and passowrds
john:123
place:Abc457
etc.
Final lists:
john
place
etc.
and 2'nd list.txt
123
Abc457
etc.
Well I prefer more the passwords and not necessarily the usernames, Thanks
I would use
(.*?):(.*)
. Then you can access the username as group 1 ($1
in substitutions) and the password as group 2.To create your first textfile use
$1
( http://regexr.com/3b8as )To create your second textfile use
$2
( http://regexr.com/3b8av )