 
 ;############################### Programm Info ###############################
 PrgName := "demo file renamer"
-PrgVersion := "1.04 (AHK)"
+PrgVersion := "1.05 (AHK)"
 
 ;############################### OS Detections ###############################
 If (A_PtrSize = 4)
 {
-	BitVersion := "x86"
+    BitVersion := "x86"
 }
 else
 {
-	BitVersion := "x64"
+    BitVersion := "x64"
 }
 
 ;############################### Functions ###############################
 ParsingDemofiles(RenamingMaskNumber, counter_files_quotient)
 {
-	Loop, Files, *.dem
-	{
-		counter_prog := counter_files_quotient * A_Index
-		GuiControl,, ProgressBar, %counter_prog%
-		mapstring := ""
-		File := FileOpen(A_LoopFileName, "r")
-		while !File.AtEOF
-		{
-			demofile := File.ReadLine()		
-			RegExMatch(demofile, "maps[\/\\].+\.bsp", mapstring)
-		If mapstring
-		{
-			File.Close()
-			mapstring_formated := Format("{1:s}", mapstring)			
-			continue
-		}
-		}
-		If (InStr(mapstring_formated, "maps") and InStr(mapstring_formated, "bsp"))
-		{
-		RegExMatch(mapstring_formated, "(?<=maps[\/\\]).+(?=\.bsp)", Mapname)
-		Mapname := Format("{1:s}", Mapname)
-			If (InStr(Mapname, "/") or InStr(Mapname, "\"))
-			{
-				Mapname := RegExReplace(Mapname, ".+[\/\\]", "")
-			}
-			SplitPath, A_LoopFileName,,,, FileNameNoExt
-			If (RenamingMaskNumber = 3) or (RenamingMaskNumber = 4)
-			{
-				FormatTime, mod_date, %A_LoopFileTimeModified%, yyyy-MM-dd
-			}
-			RenamingMask := []
-			RenamingMask[1] := filelist . A_LoopFileName . "`t" . FileNameNoExt . "_" . Mapname . "." . A_LoopFileExt . "`n"
-			RenamingMask[2] := filelist . A_LoopFileName . "`t" . Mapname . "_" . FileNameNoExt . "." . A_LoopFileExt . "`n"
-			RenamingMask[3] := filelist . A_LoopFileName . "`t" . mod_date . "_" . Mapname . "_" . FileNameNoExt . "." . A_LoopFileExt . "`n"
-			RenamingMask[4] := filelist . A_LoopFileName . "`t" . mod_date . "_" . FileNameNoExt . "_" . Mapname . "." . A_LoopFileExt . "`n"
-			filelist := RenamingMask[RenamingMaskNumber]
-		}
-		else
-		{
-			filelist_failed := filelist_failed . A_LoopFileName . "`n"
-			counter_failed += 1
-		}
-	}
-	return [filelist, filelist_failed, counter_failed]
+    Loop, Files, *.dem
+    {
+
+        counter_prog := counter_files_quotient * A_Index
+        GuiControl,, ProgressBar, %counter_prog%
+        mapstring := ""
+        mapstring_formated := ""
+        File := FileOpen(A_LoopFileName, "r")
+        while !File.AtEOF
+        {
+            demofile := File.ReadLine()
+            RegExMatch(demofile, "maps[\/\\].+\.bsp", mapstring)
+            If mapstring
+            {
+                File.Close()
+                mapstring_formated := Format("{1:s}", mapstring)
+                continue
+            }
+        }
+
+        If (InStr(mapstring_formated, "maps") and InStr(mapstring_formated, "bsp"))
+        {
+            RegExMatch(mapstring_formated, "(?<=maps[\/\\]).+(?=\.bsp)", Mapname) ;regex lookahead and lookbehind
+            Mapname := Format("{1:s}", Mapname)
+            If (InStr(Mapname, "/") or InStr(Mapname, "\"))
+            {
+                Mapname := RegExReplace(Mapname, ".+[\/\\]", "")
+            }
+            SplitPath, A_LoopFileName,,,, FileNameNoExt
+            If (RenamingMaskNumber = 3) or (RenamingMaskNumber = 4)
+            {
+                FormatTime, mod_date, %A_LoopFileTimeModified%, yyyy-MM-dd
+            }
+            RenamingMask := []
+            RenamingMask[1] := filelist . A_LoopFileName . "`t" . FileNameNoExt . "_" . Mapname . "." . A_LoopFileExt . "`n"
+            RenamingMask[2] := filelist . A_LoopFileName . "`t" . Mapname . "_" . FileNameNoExt . "." . A_LoopFileExt . "`n"
+            RenamingMask[3] := filelist . A_LoopFileName . "`t" . mod_date . "_" . Mapname . "_" . FileNameNoExt . "." . A_LoopFileExt . "`n"
+            RenamingMask[4] := filelist . A_LoopFileName . "`t" . mod_date . "_" . FileNameNoExt . "_" . Mapname . "." . A_LoopFileExt . "`n"
+            filelist := RenamingMask[RenamingMaskNumber]
+        }
+        else
+        {
+            filelist_failed := filelist_failed . A_LoopFileName . "`n"
+            counter_failed += 1
+        }
+
+    }
+    return [filelist, filelist_failed, counter_failed]
 }
 
 ;############################### GUI ###############################
 Menu, helpmenu, Add, Help , MenuHelp
 Menu, helpmenu, Add
+Menu, helpmenu, Add, License, MenuLicense
 Menu, helpmenu, Add, About, MenuAbout
 Menu, topmenu, Add, &Help, :helpmenu
 Gui, Menu, topmenu

﻿; ===================================================================================
; AHK Version .........: 1.1.24.01
; Version .............: 1.04 (AHK)
; Release Date ........: 2016-09-23
; GitHub ..............: https://github.com/chao-samu/demo-file-renamer
; Author ..............: chao-samu
;------------------------------------------------------------------------------------

Gui, Help:Show, w450 h240, Help
return

MenuLicense:
Gui, License:+owner1
Gui +Disabled
Gui, License:Add, Text, r9 vMeinEdit,
(
The MIT License (MIT)

Copyright (c) 2017 chao-samu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
