x:Uid="XXXXX"
I want to remove all these tags from a Xaml file. Is there a regex I can use to take them all out? XXXXX can be anything. And note a space before the x.
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
x:Uid="XXXXX"
I want to remove all these tags from a Xaml file. Is there a regex I can use to take them all out? XXXXX can be anything. And note a space before the x.
Regex:
\s+x:Uid=\"[^\"]+\"
in C#:
var regex = "\\s+x:Uid=\\\"[^\\\"]+\\\"";
... try that
Edit: Updated regex.
ktr said:Regex:
\s+x:Uid=\"[^\"]+\"
in C#:
var regex = "\\s+x:Uid=\\\"[^\\\"]+\\\"";
... try that
Edit: Updated regex.
Unknown operator on the :
Might need an escape or something?
Harlequin said:ktr said:*snip*Unknown operator on the :
Might need an escape or something?
Hmm.. that is strange. That is definitely the right expression. It works with C#'s regex engine and Javascript's engine too. I tried using it in VS2008's find dialog and I got the same error. I don't know how to fix that. I think they have some custom searches you can perform that are prefixed with a colon. That kind of botches the regex functionality...
ktr said:Harlequin said:*snip*Hmm.. that is strange. That is definitely the right expression. It works with C#'s regex engine and Javascript's engine too. I tried using it in VS2008's find dialog and I got the same error. I don't know how to fix that. I think they have some custom searches you can perform that are prefixed with a colon. That kind of botches the regex functionality...
Ok.. i finally figured it out... VS has a different syntax for finding whitespace (:Wh). Anyway, here it is (this will only work in the find dialog):
:Whx\:Uid="([^"]|:Wh)*"
ktr said:Harlequin said:*snip*Hmm.. that is strange. That is definitely the right expression. It works with C#'s regex engine and Javascript's engine too. I tried using it in VS2008's find dialog and I got the same error. I don't know how to fix that. I think they have some custom searches you can perform that are prefixed with a colon. That kind of botches the regex functionality...
Visual Studio's find dialog uses a different regex syntax. This ought to do the trick:
:b+x\:Uid="[^"]+"
Sven Groot said:ktr said:*snip*Visual Studio's find dialog uses a different regex syntax. This ought to do the trick:
:b+x\:Uid="[^"]+"
Not when there are newlines between the quotes.
ktr said:Sven Groot said:*snip*Not when there are newlines between the quotes.
If there are newlines between the quotes, then it isn't a valid XML file. ![]()
Sven Groot said:ktr said:*snip*Visual Studio's find dialog uses a different regex syntax. This ought to do the trick:
:b+x\:Uid="[^"]+"
Gimme 3 weeks to try it out...on vacation now ![]()
Cheers
Harlequin said:Sven Groot said:*snip*Gimme 3 weeks to try it out...on vacation now
Cheers
what kind of vacation is that without a laptop with Visual Studio connected to the internet? ![]()
Ion Todirel said:Harlequin said:*snip*what kind of vacation is that without a laptop with Visual Studio connected to the internet?
:b+x\:Uid="[^"]+" worked awesome, thanks a bunch.
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.