ffdshow Posted July 21, 2014 Share Posted July 21, 2014 Hi, I have a large registry value that contain the next string: <audioSettings><deviceId>Realtek Digital Input (Realtek </deviceId> The string "Realtek Digital Input (Realtek" can be "Microphone (SB Audigy)" or else. I want to change "Realtek Digital Input (Realtek" or whatever is between <audioSettings><deviceId> and </deviceId> with "NO_MIC", to look finally like this: <audioSettings><deviceId>NO_MIC</deviceId> How should look the StringRegExpReplace command? Link to comment Share on other sites More sharing options...
Solution mikell Posted July 22, 2014 Solution Share Posted July 22, 2014 $str = "<audioSettings><deviceId>Realtek Digital Input (Realtek </deviceId>" Msgbox(0,"", StringRegExpReplace($str, '(?<=<deviceId>)([^<]+)', "NO_MIC") ) ffdshow 1 Link to comment Share on other sites More sharing options...
ffdshow Posted July 22, 2014 Author Share Posted July 22, 2014 (edited) Thanks! The script should look like this: $string = RegRead("HKEY_CURRENT_USER\Software\TechSmith\Camtasia Studio\8.0\Camtasia Recorder\8.0", "RecorderConfig") $replace = "NO_MIC" $new_string = StringRegExpReplace($string, '(?<=<deviceId>)([^<]+)', $replace) RegWrite("HKEY_CURRENT_USER\Software\TechSmith\Camtasia Studio\8.0\Camtasia Recorder\8.0", "RecorderConfig", "REG_SZ", $new_string) Edited July 22, 2014 by ffdshow Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now