Skip to content

Instantly share code, notes, and snippets.

@balmyBanzai
balmyBanzai / crv.cpp
Last active January 12, 2017 06:29
cmd_regex_verifier
/* Commandline Regular Expression (regex) Verifier Tool
* This tool finds the first partial match in the regex's capture group 1 in the string and pipes it to stdout and exits 0 on success.
* Parameter 1 is the string to search, e.g., "C:\Some\Directory\with\a\special\file_unique12354.exe"
* Parameter 2 is the regex, e.g., "\\.+(thing to find after last backslash, like `name`).+$"
* which would be written like, "\\.+\\.+(unique.+)\."
* From CMD.exe>call crv.exe "C:\Some\Directory\with\a\special\file_unique12354.exe" "\\.+\\.+(unique.+)\."
* That would pipe unique12354 to STDOUT and exit 0.
*/
#include <iostream>
@balmyBanzai
balmyBanzai / parameter_expansion_tips_cmd.md
Last active January 5, 2017 22:04
Parameter Expansion tips
All of These tips were taken directly from Jon Galloway's "Top 10 DOS Batch tips (Yes, DOS Batch...)" article from Monday, November 20, 2006 at https://weblogs.asp.net/jongalloway/top-10-dos-batch-tips-yes-dos-batch
This gist is for posterity in the event of the site's removal or expiration

batchparams.bat

@echo off
echo %%~1     =      %~1 
echo %%~f1     =      %~f1
echo %%~d1     =      %~d1
echo %%~p1     =      %~p1
@balmyBanzai
balmyBanzai / mew.md
Created February 16, 2016 23:32
Testing horizontal line rule in markdown

Horizontal Rule Example

Paragraph 1

Paragraph 2