+ 2

How can I solve this problem ?

This is my first time solving a hard code coach. I tried password validation using regex, but I failed 8 test cases. Please can someone give me a little help.using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Text.RegularExpressions; namespace SoloLearn { class Program { static void Main(string[] args) { string input = Console.ReadLine(); var numbers = new Regex("@[0-9]"); var characters = new Regex("@[^£$#!&%*@]"); var length = new Regex("@[{7,}]"); if (numbers.IsMatch(input) && characters.IsMatch(input) && length.IsMatch(input)) { Console.WriteLine("strong"); } else { Console.WriteLine("Weak"); } } } }

4th May 2020, 7:43 PM
Joseph Oritseweyinmi
Joseph Oritseweyinmi - avatar
4 Answers
+ 2
If your solution do not work you should test your code step by step in the playground. Take some text and write what come out after each regex statement. Is that what you expected?
4th May 2020, 7:58 PM
JaScript
JaScript - avatar
+ 2
Thank you ja play.
4th May 2020, 8:00 PM
Joseph Oritseweyinmi
Joseph Oritseweyinmi - avatar
+ 2
Your welcome!
4th May 2020, 8:19 PM
JaScript
JaScript - avatar
0
saandow
5th May 2020, 12:22 AM
ساندو باقمري
ساندو باقمري - avatar