"All I needed" was a simple function to do string.replace(/regex/, callback_function) so that I could find some matches in a string and then call my own custom function to return the value to be ...
filename File names (Only letters, digits, '-', '_', '.' are allowed. Spaces allowed only in middle and not at the start or end) ...