What do \S, \W, \D stand for in regex?

\W is the opposite of \w and \D is the opposite of \d. It’s just like \S is the opposite of \s. \W and \D respectively will match what \w and \d respectively don’t match. You can have a look at this site for some more explanation. \w typically matches [A-Za-z0-9_] (ignoring the foreign characters) … Read more

NSTask not picking up $PATH from the user’s environment

Try, [task setLaunchPath:@”/bin/bash”]; NSArray *args = [NSArray arrayWithObjects:@”-l”, @”-c”, @”which git”, nil]; [task setArguments: args]; This worked for me on Snow Leopard; I haven’t tested on any other system. The -l (lowercase L) tells bash to “act as if it had been invoked as a login shell”, and in the process it picked up my … Read more

What options are available for Shell32.Folder.GetDetailsOf(..,..)?

I figured this out by accident. If you pass null into GetDetailsOf then it responds with the column names. For example, execute the following JScript with cscript: var shellapp = WScript.CreateObject(“Shell.Application”); var folder = shellapp.NameSpace(“D:\\”); for (var j = 0; j < 0xFFFF; j++) { detail = folder.GetDetailsOf(null, j); if (!detail) { break; } WScript.Echo(“[” … Read more

How to expand a CMD shell variable twice (recursively)

Thinking in terms of a less tortuous solution, this, too, produces the CCC you desire. setlocal enabledelayedexpansion set AAA=BBB set BBB=CCC for /F %%a in (‘echo %AAA%’) do echo !%%a! edit: to dissect this answer: setlocal enabledelayedexpansion – this will allow for any environment variable setting during your bat to be used as modified during … Read more