diff --git a/RegEx/JavaScript/Method.regex.source.ps1 b/RegEx/JavaScript/Method.regex.source.ps1 new file mode 100644 index 0000000..5054c8e --- /dev/null +++ b/RegEx/JavaScript/Method.regex.source.ps1 @@ -0,0 +1,12 @@ +$myName = ($MyInvocation.MyCommand.ScriptBlock.File | Split-Path -Leaf) -replace '\.source', '' -replace '\.ps1', '.txt' +$myRoot = $MyInvocation.MyCommand.ScriptBlock.File | Split-Path + +New-Regex -Description "JavaScript Method" | + New-RegEx -After '[\r\n\;]' -Comment 'After a newline or semicolon' | + New-RegEx -Pattern '\s{0,}' -Comment 'Optional whitespace' | + New-RegEx -Name MethodName -Pattern '[^/\(\)\{\}]' -Repeat -Comment 'Method Name' | + New-RegEx -Pattern '\s{0,}' -Comment 'Optional whitespace' | + New-RegEx -Name MemberParameters -Pattern '?' -Comment 'Method Parameters' | + New-RegEx -Pattern '\s{0,}' -Comment 'Optional whitespace' | + New-RegEx -Name MemberBody -Pattern '?' -Comment 'Method Body' | + Set-Content -Path (Join-Path $myRoot $myName) \ No newline at end of file