Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a tool or method with which I can search the windows registry with regular expressions?

share|improve this question

4 Answers 4

up vote 4 down vote accepted

The free RegAlyzer utility searches by substring, wildcard (*,?), boolean (AND OR NOT), and regular expression:

RegAlyzer is a tool to browse and change the registry. It was created because of a few features we missed in the original regedit tool, from support for exotic value types over background and regular expression search to better bookmarks, displaying .reg files in the accustomed style and a history view.

image

share|improve this answer

If it's just a matter of searching it without changing anything (no Search & Replace), export the whole registry to a .reg file and use your favorite text editor that supports regular expressions (Notepad++, Textpad, PSPad, ...).

To export the whole registry, right-click the Computer node in Registry Editor and select Export.

Watch out, the exported file can be huge. I just tried and the file was 250 MB big.

Encoding update: On WinXP, cygwin's file utility reports the exported data as Unicode text, UTF-16, little-endian.

share|improve this answer
    
well, yes, I guess that would do, if only the the exported file wouldn't be 256'803'816 bytes in size. Also, I have no idea in what encoding the file is written. –  René Nyffenegger Nov 4 '09 at 18:12
    
+1. as a bonus, by exporting you've just backed up your registry. –  quack quixote Nov 5 '09 at 4:32

You can use PowerShell with -match:

dir HKCU:\ -rec -ea SilentlyContinue |   

ForEach-Object {   
       if((get-itemproperty -Path $_.PsPath) -match "\wSomestring\w")  
    {   
          $_.PsPath
    }   
}

This will search the HKEY_CURRENT_USER hive.

share|improve this answer
    
This sounds promising. I have never used PowerShell before, however. I'll give it a try. –  René Nyffenegger Nov 4 '09 at 18:13
1  
A good overview of regex with -match can be found here: 207.46.16.252/en-us/magazine/2007.11.powershell.aspx –  John T Nov 4 '09 at 18:21
    
This works but takes a while to search the whole hive. I'd rather use this because I already have PS installed and like it. –  Bratch Nov 4 '09 at 19:31

Even reg.exe does not seem to support it, but it might help getting a list to process with other command line tools. See reg.exe query.

share|improve this answer
    
Although this is not exactly what I was looking for (because of the missing regex suport), it's certainly an appreciated link/hint. –  René Nyffenegger Nov 4 '09 at 18:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.