Regex is not working properly in C# WPF Application -
the below regex condition matching below website regex pattern
input[\s?[abcd]+\s?(,\s?[-*][0-9]+%)?](?=\s)
website link: http://regexr.com/
but in wpf application same regex not working.
code snippet
if( regex.match(this.textbox.text, "input\\[\\s?[abcd] +\\s ? (,\\s?[-*][0 - 9] +%)?\\](?=\\s)|[?=\\t] |[?=\\s]").success) { messagebox.show("regex matched"); }
can please suggest, how can proceed on this?
but in wpf application same regex not working.
no. it's not same regex, there's additional \
after input
in c# app. same:
if( regex.match(this.textbox.text, @"input\[\s?[abcd]+\s?(,\s?[-*][0-9]+%)?\](?=\s)").success) { messagebox.show("regex matched"); }
Comments
Post a Comment