I have a table element 'ClassTable' which contains text as follows:
"Class Name\r\nCreated By\r\nClass Type\r\nClass Code\r\nMathematics Grade 6\r\nTeacher1\r\nSchool\r\n7BD6231E\r\nManage"
The above text contains a random 8 digit Hex code 7BD6231E which changes after each validation.
Is there any way to match the whole text using Selenium WebDriver or C# with Regex like [A-F0-9]{8} for the random hex code so that my validation passes every time without any issues as the Hex Code will change every time.
I have tried the Regex [A-F0-9]{8} with ClassTable.Text.Contains function as follows but I guess Regex is not supported in Text.Contains function.
ClassTable.Text.Contains("Class Name\r\nCreated By\r\nClass Type\r\nClass Code\r\nMathematics Grade 6\r\nTeacher1\r\nSchool\r\n[A-F0-9]{8}\r\nManage");
The suggested solutions should match the whole text including the random Hex Code. Thanks.