use strict;
my $str = '# SciTE settings for AutoIt v3
#
# Oct 25, 2015 - Jos
#
# *** Specify here your AutoIt Include directories ***
openpath.$(au3)=$(SciteDefaultHome)\\..\\include
openpath.beta.$(au3)=$(SciteDefaultHome)\\..\\beta\\include
# *** Specify here the name you want to use of the UDF header creator ***
UDFCreator=Your Name
#
au3=*.au3
filter.au3=AutoIt (au3)|$(au3)|
lexer.$(au3)=au3
# left for others but not in use anymore.
autoit3dir=$(SciteDefaultHome)\\..
#define the number of backup files you want to keep 0=none
backup.files=0
#define the activation of the ProperCase function using au3.api. 0=no change, 1=Propercase functions and keywords automatically
proper.case=0
## Debug Output Options (to permanent change your selection copy them to SciTEUser.Properties and change it there
# Debug MessageBox Option 2="All" 1="No @extended" 0="No @extended & @error".
debug.msgbox.option=0
# Debug Console Option 3="All" 2="No SystemTime" 1="No SystemTime & Return" 0="No SystemTime, Return & Error".
debug.console.option=1
# Debug Trace Option 3="All" 2="No SystemTime" 1="No SystemTime & Return" 0="No SystemTime, Return & Error".
debug.trace.option=1
# extra propery used by AutoItAutoComplete.LUA to totally disable AutoComplete when set to 1
autocomplete.au3.disable=0
calltips.au3.disable=0
# AutoIt Pixmap information
import properties\\au3.pixmap
autoit.use.pixmaps=1
autoit.pixmap.function=$(autoit.pixmap.violet)
autoit.pixmap.variable=$(autoit.pixmap.gray)
autoit.pixmap.macro=$(autoit.pixmap.orange)
autoit.pixmap.keyword=$(autoit.pixmap.blue)
autoit.pixmap.library=$(autoit.pixmap.blue_library)
autoit.pixmap.preprocessor=$(autoit.pixmap.olive)
autoit.pixmap.special=$(autoit.pixmap.red_special)
# CreateTools()
autoit.CreateToolsStart=19
shortcuts.properties=$(SciteDefaultHome)\\shortcuts.properties
# Commands to compile / run your script
command.go.$(au3)="$(SciteDefaultHome)\\..\\AutoIt3.exe" "$(SciteDefaultHome)\\AutoIt3Wrapper\\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "$(FilePath)" /UserParams $(1) $(2) $(3) $(4)
command.go.subsystem.$(au3)=1
command.compile.$(au3)="$(SciteDefaultHome)\\..\\AutoIt3.exe" "$(SciteDefaultHome)\\AutoIt3Wrapper\\AutoIt3Wrapper.au3" /ShowGui /prod /in "$(FilePath)"
command.compile.filter.$(au3)=1
command.build.$(au3)="$(SciteDefaultHome)\\..\\AutoIt3.exe" "$(SciteDefaultHome)\\AutoIt3Wrapper\\AutoIt3Wrapper.au3" /NoStatus /prod /in "$(FilePath)"
command.build.filter.$(au3)=1
# ----------------------------------------------------------------------------------------------------------------
# AutoitTools.lua will check if Beta is installed and use these te set the menu options
#x 00 Beta RUN
command.0.beta=Beta Run
command.0.$(au3)="$(SciteDefaultHome)\\..\\AutoIt3.exe" "$(SciteDefaultHome)\\AutoIt3Wrapper\\AutoIt3Wrapper.au3" /run /beta /ErrorStdOut /in "$(FilePath)" /UserParams $(1) $(2) $(3) $(4)
command.name.0.$(au3)=Beta Run
command.save.before.0.$(au3)=1
command.shortcut.0.$(au3)=Alt+F5
#x 01 Beta AUT2EXE
command.1.beta=Beta Compile
command.1.$(au3)="$(SciteDefaultHome)\\..\\AutoIt3.exe" "$(SciteDefaultHome)\\AutoIt3Wrapper\\AutoIt3Wrapper.au3" /NoStatus /beta /in "$(FilePath)"
command.name.1.$(au3)=Beta Compile
command.save.before.1.$(au3)=1
command.shortcut.1.$(au3)=Alt+F7
command.is.filter.1.$(au3)=1
#x 02 Beta Helpfile
command.2.beta=Beta Help
command.2.$(au3)=$(SciteDefaultHome)\\..\\beta\\Autoit3Help.exe "$(CurrentWord)"
command.name.2.$(au3)=Beta Help
command.subsystem.2.$(au3)=2
command.shortcut.2.$(au3)=Alt+F1
command.save.before.2.$(au3)=2
#x 03 Tylo\'s au3check program for Prod
command.3.$(au3)="$(SciteDefaultHome)\\..\\AutoIt3.exe" "$(SciteDefaultHome)\\AutoIt3Wrapper\\AutoIt3Wrapper.au3" /Prod /AU3check /in "$(FilePath)"
command.name.3.$(au3)=SyntaxCheck Prod
command.shortcut.3.$(au3)=Ctrl+F5
command.save.before.3.$(au3)=1
#x 04 Tylo\'s au3check program for Beta
command.4.beta=SyntaxCheck Beta
command.4.$(au3)="$(SciteDefaultHome)\\..\\AutoIt3.exe" "$(SciteDefaultHome)\\AutoIt3Wrapper\\AutoIt3Wrapper.au3" /beta /AU3check /in "$(FilePath)"
command.name.4.$(au3)=SyntaxCheck Beta
command.shortcut.4.$(au3)=Ctrl+Alt+F5
command.save.before.4.$(au3)=1
# ----------------------------------------------------------------------------------------------------------------
# 05 Open Explorer in Scriptdir
command.5.*=Explorer.exe /e,/select,"$(FilePath)"
command.name.5.*=Open Explorer in ScriptDir
command.shortcut.5.*=Ctrl+E
command.subsystem.5.*=2
command.save.before.5.*=2
command.replace.selection.5.*=0
command.quiet.5.*=1
# 06 AU3Info program
command.6.$(au3)="$(SciteDefaultHome)\\..\\AutoIt3.exe" "$(SciteDefaultHome)\\AutoIt3Wrapper\\AutoIt3Wrapper.au3" /AU3info
command.name.6.$(au3)=AU3Info
command.shortcut.6.$(au3)=Ctrl+F6
command.subsystem.6.$(au3)=2
command.save.before.6.$(au3)=2
command.quiet.6.$(au3)=1
# 07 Test Run
command.7.$(au3)="$(SciteDefaultHome)\\..\\AutoIt3.exe" "$(SciteDefaultHome)\\AutoIt3Wrapper\\AutoIt3Wrapper.au3" /test /run /prod /ErrorStdOut /in "$(FilePath)" /UserParams $(1) $(2) $(3) $(4)
command.name.7.$(au3)=Test Run
command.shortcut.7.$(au3)=Shift+F5
command.save.before.7.$(au3)=1
# 08 Test AUT2EXE
command.8.$(au3)="$(SciteDefaultHome)\\..\\AutoIt3.exe" "$(SciteDefaultHome)\\AutoIt3Wrapper\\AutoIt3Wrapper.au3" /test /in "$(FilePath)"
command.name.8.$(au3)=Test Compile
command.shortcut.8.$(au3)=Shift+F7
command.save.before.8.$(au3)=1
# 09 Jos\'s Tidy formatting program for Autoit3
command.9.$(au3)="$(SciteDefaultHome)\\..\\AutoIt3.exe" "$(SciteDefaultHome)\\AutoIt3Wrapper\\AutoIt3Wrapper.au3" /Tidy /in "$(FilePath)"
command.name.9.$(au3)=Tidy AutoIt Source
command.subsystem.9.$(au3)=0
command.save.before.9.$(au3)=1
command.shortcut.9.$(au3)=Ctrl+T
#~ command.is.filter.9.$(au3)=1
# 10 Giuseppe\'s CodeWizard program
command.10.$(au3)="$(SciteDefaultHome)\\..\\AutoIt3.exe" "$(SciteDefaultHome)\\CodeWizard\\CodeWizard.au3" "/StdOut"
command.subsystem.10.$(au3)=1
command.name.10.$(au3)=CodeWizard
command.shortcut.10.$(au3)=Alt+W
command.save.before.10.$(au3)=2
command.replace.selection.10.$(au3)=1
command.quiet.10.$(au3)=1
# 12 lookfar\'s Koda FormDesigner
command.12.$(au3)="$(SciteDefaultHome)\\Koda\\FD.exe" /Scite
command.subsystem.12.$(au3)=1
command.name.12.$(au3)=Koda(FormDesigner)
command.shortcut.12.$(au3)=Alt+m
command.save.before.12.$(au3)=2
command.replace.selection.12.$(au3)=1
command.quiet.12.$(au3)=1
# 14 Jos\'s SciTeConfig
command.14.$(au3)="$(SciteDefaultHome)\\..\\AutoIt3.exe" "$(SciteDefaultHome)\\SciteConfig\\SciteConfig.au3"
command.name.14.$(au3)=SciTe Config
command.shortcut.14.$(au3)=Ctrl+1
command.subsystem.14.$(au3)=2
command.save.before.14.$(au3)=2
command.replace.selection.14.$(au3)=0
command.quiet.14.$(au3)=1
# 15 Update Source in Version repository
command.15.*="$(SciteDefaultHome)\\..\\AutoIt3.exe" "$(SciteDefaultHome)\\AutoIt3Wrapper\\AutoIt3Wrapper.au3" /in "$(FilePath)" /Versioning_Commit
command.name.15.*=Version Update Source
command.save.before.15.*=1
command.shortcut.15.*=F12
# 16 Compare current Source with the source in the Version repository
command.16.*="$(SciteDefaultHome)\\..\\AutoIt3.exe" "$(SciteDefaultHome)\\AutoIt3Wrapper\\AutoIt3Wrapper.au3" /in "$(FilePath)" /Versioning_ShowDiff
command.name.16.*=Version Diff Source
command.save.before.16.*=1
command.shortcut.16.*=Alt+F12
command.quiet.16.*=1
# 17 guinness SciTE Jump
command.17.$(au3)="$(SciteDefaultHome)\\..\\AutoIt3.exe" "$(SciteDefaultHome)\\\\SciTE Jump\\SciTE Jump.au3"
command.name.17.$(au3)=SciTE Jump
command.shortcut.17.$(au3)=Alt+Q
command.subsystem.17.$(au3)=2
command.save.before.17.$(au3)=2
command.replace.selection.17.$(au3)=0
command.quiet.17.$(au3)=1
# Standard LUA Functions
# 18 Jump to Func quickly
command.name.18.$(au3)=Jump to Function Prod
command.mode.18.$(au3)=subsystem:lua,savebefore:yes
command.shortcut.18.$(au3)=Ctrl+J
command.18.$(au3)=InvokeTool AutoItGotoDefinition.GotoDefinition
# 19 Jump Beta function quickly
command.19.beta=Jump to Function Beta
command.name.19.$(au3)=Jump to Function Beta
command.mode.19.$(au3)=subsystem:lua,savebefore:yes
command.shortcut.19.$(au3)=Ctrl+Alt+J
command.19.$(au3)=InvokeTool AutoItGotoDefinition.GotoDefinition beta
# 20 Jump Back to original spot
command.name.20.$(au3)=Jump Back
command.mode.20.$(au3)=subsystem:lua,savebefore:yes
command.shortcut.20.$(au3)=Ctrl+Shift+J
command.20.$(au3)=InvokeTool AutoItGotoDefinition.JumpBack
# 21 List functions
command.name.21.$(au3)=List Functions
command.21.$(au3)=InvokeTool AutoItTools.FunctionsList
command.subsystem.21.$(au3)=3
command.mode.21.$(au3)=savebefore:no
command.shortcut.21.$(au3)=Alt+L
# 22 Replacement toggle LUA script for MONOSPACE font
command.name.22.$(au3)=Toggle Override Font
command.mode.22.$(au3)=subsystem:lua,savebefore:no
command.shortcut.22.$(au3)=Ctrl+F11
command.22.$(au3)=InvokeTool Tools.toggleOverrideFont
# 23 Available
command.name.23.$(au3)=
command.subsystem.23.$(au3)=
command.23.$(au3)=
command.shortcut.23.$(au3)=
command.save.before.23.$(au3)=2
# 24 Add a msgbox for debugging
command.name.24.$(au3)=Debug to MsgBox
command.subsystem.24.$(au3)=3
command.24.$(au3)=InvokeTool AutoItTools.DebugMsgBoxAdd
command.shortcut.24.$(au3)=Ctrl+Shift+D
command.save.before.24.$(au3)=2
# 25 Add a Console msg for debugging
command.name.25.$(au3)=Debug to Console
command.subsystem.25.$(au3)=3
command.25.$(au3)=InvokeTool AutoItTools.DebugConsoleWriteAdd
command.shortcut.25.$(au3)=Alt+D
command.save.before.25.$(au3)=2
# 26 Remove Console and MSGBOX debug lines
command.name.26.$(au3)=Debug Remove lines
command.subsystem.26.$(au3)=3
command.26.$(au3)=InvokeTool AutoItTools.DebugRemove
command.shortcut.26.$(au3)=Ctrl+Alt+Z
command.save.before.26.$(au3)=2
# 27 Add ConsoleWrite Trace lines
command.name.27.$(au3)=Trace: Add Trace Lines
command.subsystem.27.$(au3)=3
command.27.$(au3)=InvokeTool AutoItTools.TraceAdd
command.shortcut.27.$(au3)=
command.save.before.27.$(au3)=2
# 28 Add ConsoleWrite Function Trace lines
command.name.28.$(au3)=Trace: Add Func Trace Lines
command.subsystem.28.$(au3)=3
command.28.$(au3)=InvokeTool AutoItTools.FunctionTraceAdd
command.shortcut.28.$(au3)=
command.save.before.28.$(au3)=2
# 29 Remove Trace Console lines
command.name.29.$(au3)=Trace: Remove ALL Trace lines
command.subsystem.29.$(au3)=3
command.29.$(au3)=InvokeTool AutoItTools.AllTraceRemove
command.shortcut.29.$(au3)=
command.save.before.29.$(au3)=2
# 30 Comment Console and MSGBOX debug lines
command.name.30.$(au3)=DebugTrace: Comment ALL lines
command.subsystem.30.$(au3)=3
command.30.$(au3)=InvokeTool AutoItTools.AllComment
command.shortcut.30.$(au3)=Alt+Shift+D
command.save.before.30.$(au3)=2
# 31 UnComment Console and MSGBOX debug lines
command.name.31.$(au3)=DebugTrace: UnComment ALL lines
command.subsystem.31.$(au3)=3
command.31.$(au3)=InvokeTool AutoItTools.AllUncomment
command.shortcut.31.$(au3)=Alt+Ctrl+D
command.save.before.31.$(au3)=2
# 32 Open #include File
command.name.32.$(au3)=Open Include
command.mode.32.$(au3)=subsystem:lua,savebefore:no
command.shortcut.32.$(au3)=Alt+I
command.32.$(au3)=InvokeTool AutoItTools.OpenInclude
# 33 Open BETA #include File
command.33.beta=Open Include Beta
command.name.33.$(au3)=Open Include Beta
command.mode.33.$(au3)=subsystem:lua,savebefore:no
command.shortcut.33.$(au3)=Alt+Shift+I
command.33.$(au3)=InvokeTool AutoItTools.OpenBetaInclude
# 34 Generate UDF header
command.name.34.$(au3)=Make UDF Header
command.mode.34.$(au3)=subsystem:lua,savebefore:no
command.shortcut.34.$(au3)=Ctrl+Alt+H
command.34.$(au3)=InvokeTool AutoItTools.InsertFunctionHeader
# Commands to for Help F1
command.help.$(au3)=$(SciteDefaultHome)\\..\\Autoit3Help.exe "$(CurrentWord)"
command.help.subsystem.$(au3)=2
# Autocomplete and call tip settings
api.$(au3)=$(SciteDefaultHome)\\api\\au3.api;$(SciteDefaultHome)\\api\\au3.autoit3wrapper.api;$(SciteUserHome)\\au3.user.calltips.api
calltip.au3.word.characters=$(chars.alpha)$(chars.numeric)_.
calltip.au3.ignorecase=1
calltip.au3.end.definition=)
calltip.au3.parameters.separators=,
# set the style for separator character # Only available in SciTE4AutoIt3 version
calltip.au3.delimiter.style=8
# Display the calltip above the function # Only available in SciTE4AutoIt3 version
calltips.set.above=0
# Set the highlight color of the function argument # Only available in SciTE4AutoIt3 version
calltips.color.highlight=#FF0000
# Set the fore and back color of the calltip window
style.au3.38=fore:#050505,back:#FFFFFF
#
autocomplete.au3.ignorecase=1
autocomplete.au3.start.characters=$(chars.alpha)$(chars.numeric)$_@#
word.characters.$(au3)=$(chars.alpha)$(chars.numeric)$(chars.accented).$_@#
# Auto indent stuff
#~ indent.size.$(au3)=4
statement.indent.$(au3)=
statement.end.$(au3)=
statement.lookback.$(au3)=
block.start.$(au3)=5 case if do for func else elseif while select switch with\\
Case If Do For Func Else ElseIf While Select Switch With\\
CASE IF DO FOR FUNC ELSE ELSEIF WHILE SELECT SWITCH WITH
block.end.$(au3)=5 case else endif elseif endfunc endselect endswitch next until wend endwith\\
Case Else EndIf ElseIf EndFunc EndSelect EndSwitch Next Until Wend WEnd EndWith\\
CASE ELSE ENDIF ELSEIF ENDFUNC ENDSELECT ENDSWITCH NEXT UNTIL WEND ENDWITH
#Comments functions definition
comment.block.au3=;~
comment.block.at.line.start.au3=1
comment.stream.start.au3=#CS
comment.stream.end.au3=#CE
comment.box.start.au3=#CS
comment.box.middle.au3=;
comment.box.end.au3= #CE
# Import the seperate au3.keywords.properties file containing AutoIt3 info (based on script by Valik)
import properties\\au3.keywords
import properties\\autoit3wrapper.keywords
# Import the seperate au3.keywords.Abbreviations.properties file containing Abbreviation keywords supplied by Mhz
import properties\\au3.keywords.abbreviations
#
# Add the below lines to your SciTEUser.properties when you want to add User Abbreviations and UDFS
#import au3.keywords.user.abbreviations
#import au3.UserUdfs
# Autoit keywords
keywords.$(au3)=$(au3.keywords.keywords)
# Autoit functions
keywords2.$(au3)=$(au3.keywords.functions)
# Autoit macros
keywords3.$(au3)=$(au3.keywords.macros)
# Autoit Send Keys
keywords4.$(au3)=$(au3.keywords.sendkeys)
#Pre-Processor
keywords5.$(au3)=$(au3.keywords.preprocessor)
#Special
keywords6.$(au3)=$(au3.keywords.special) $(autoit3wrapper.keywords.special)
# Expand abbreviations
keywords7.$(au3)=$(au3.keywords.abbrev) $(au3.keywords.userabbrev)
# UDFS
keywords8.$(au3)=$(au3.keywords.udfs)
# UDFS User
keywords9.$(au3)=$(au3.keywords.user.udfs)
#Color Settings
#Background
style.au3.32=style.*.32=$(font.base),back:#F0F4F9
#CaretLineBackground
caret.line.back=#FFFED8
# Brace highlight
style.au3.34=fore:#0000FF,back:#F0F4F9
# Brace incomplete highlight
style.au3.35=fore:#009933,back:#F0F4F9
# White space
style.au3.0=fore:#000000
# Comment line
style.au3.1=fore:#008000,italics
# Comment block
style.au3.2=fore:#008000,italics
# Number
style.au3.3=fore:#0000FF
# Function
style.au3.4=fore:#000090
# Keyword
style.au3.5=fore:#0000FF
# Macro
style.au3.6=fore:#808000
# String
style.au3.7=fore:#FF0000
# Operator
style.au3.8=fore:#FF8000
# Variable
style.au3.9=fore:#5A5A5A
# Send keys in string
style.au3.10=fore:#808080
# Pre-Processor
style.au3.11=fore:#808000
# Special
style.au3.12=fore:#DC143C
#Abbrev-Expand
style.au3.13=fore:#FF0000
# COM Objects
style.au3.14=fore:#993399
#Standard UDF\'s
style.au3.15=fore:#0080FF
#User UDF\'s
style.au3.16=$(style.au3.15)';
my $regex = qr/(?m)^\h*#x?\h+\d+\N+[^#]+/p;
if ( $str =~ /$regex/g ) {
print "Whole match is ${^MATCH} and its start/end positions can be obtained via \$-[0] and \$+[0]\n";
# print "Capture Group 1 is $1 and its start/end positions can be obtained via \$-[1] and \$+[1]\n";
# print "Capture Group 2 is $2 ... and so on\n";
}
# ${^POSTMATCH} and ${^PREMATCH} are also available with the use of '/p'
# Named capture groups can be called via $+{name}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html