I have an XML file and want to replace every time value from seconds to milliseconds.
For instance, replace time="250" to time="250000"
.
I tried using the following
Find: time="([0-9]*)" Replace: time="$1000"
However, that does not seem to work - it replaces time="250" to time="$1000"
. Any way I can get around this ?
The problem is that your replace isn't $1
, it is $1000
. Visual Studio doesn't know that you don't want to include those 3 0's in your backreference.
You can use {}
around your backreference to tell Visual Studio exactly what to use.
Replace: time="${1}000"
Obligatory note that Visual Studio 2010 and older used a different regular expression syntax, so this is only valid for Visual Studio 2012 (and presumably any newer versions).
Have checked the "Find Options" expansion menu + checked the "Use Regular Expressions" checkbox?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With