Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
HI all

i am trying to create an application show my list of all binding in some .xaml file
so my pattern should be some thing like this
C#
var r = new Regex(@"[ \S{0,1000}={Binding .} ]");


i need a way to tell him this symbol { or } is not a part of the pattern just check it like a symbol (handle it like a symbol)
Posted
Updated 7-Nov-11 20:16pm
v2
Comments
Andrew Brock 8-Nov-11 2:20am    
This is done with the escape character, a singe backslash (\).
In a string this should be a double backslash (\\) because the compiler also takes this escape sequence, and converts that to a single backslash in the compiled code.

1 solution

Register your free copy of Expresso[^]which is a handy tool for regular expressions
 
Share this answer
 
Comments
Mohamed Ahmed Abdullah 8-Nov-11 23:07pm    
Thank you thatraja very much

this application is very helpful

so i found the solution

var r = new Regex(@"(\s\w{0,}=""{Binding .+}""){0,}");

the previous expression will give you all the Bindings in the file

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900