Hi,
Could anyone help me out to find a solution for the below description?
I have a combo editor in my windows application and I want to find whether a word which is not supposed to be there is present.
Note, this editor has already set as a mandatory one in the property tab with other regex and message. So i will have to use this again based on a condition for example, while saving the form. So, I will use something like this
county = countyIdUltraCombo.Text.Replace(" ", "").ToString().ToUpper(); --> code to get the sting value by removing space in between
Once I get this string value, i will use it in a if condition to get into the loop and execute the below.
infragisticsErrorProvider1.SetRegexPattern(addressControl1.countyIdUltraCombo, "^(?!OFFLINE$|OFF LINE$|offline$|Offline$|oFFLINE$|oFF LINE$|Off Line$).+"); infragisticsErrorProvider1.SetRegexMessage(addressControl1.countyIdUltraCombo, "Offline is not valid"); infragisticsErrorProvider1.SetValidationEnabled(addressControl1.countyIdUltraCombo, true);
The issue is we can keep adding different arrangement of the word offline in order to make the regexpattern work, like one mentioned above.
Kindly advise how to use this effectively so that all kinds of the word offline can be a pattern.
Thanks
Preeth
Coorection, I meant different arrangements of the word Offline.
Examples are Offline, Off line,OFFLINE, OFF Line, OFF LINE, oFFLINE, Off Line, OFF L I N E, etc
Hello Preeth,
Thank you for posting in our forum.
If I understand you correctly you need a RegEx pattern which will match every possible way you may wright the word “OFFLINE”, including different spaces added around the characters of the word, and different casing of each character. One possible pattern could be this one:
[\s]*[Oo][\s]*([Ff][\s]*){2}[Ll][\s]*[Ii][\s]*[Nn][\s]*[Ee][\s]*
Please check this patter, and let me know if this is what you are looking for or if I am missing something.