Answer the question
In order to leave comments, you need to log in
How to take the password from the text "Password complex R36yhhe3" with a regular expression?
But taking into account that the phrase can be like this:
"Password R36yhhe3"
I wanted to use this regular expression: (?<=Пароль\ сложный|Пароль\ ).*
Assuming that the order will be observed, they say, if it does not find what comes after "Password complex", then let it look for what comes simply after "Password". But it did not work, the order is not respected, apparently it stops at the first shortest match. It always outputs "complex R36yhhe3" as a result. And I don't need the word "complex".
How to keep order in conditional OR ("|") in regular expressions?
Answer the question
In order to leave comments, you need to log in
var pattern = @"Пароль\sсложный\s([\w\d]+)";
var matches = Regex.Matches(input, pattern);
var result = match.Groups[1].Value;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question