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/

screenshot

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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -