Sublime Forum

RegEx for custom build system MQL4

#1

Hi,

I have a custom build system (MQL4) in Sublime text 3.

I tried learn RegEx but I did not get it.

This is my attempt:

{
	"shell_cmd": "e:\\MT.DEMO\\MT4\\FxPro.VTS\\mql64.exe /mql4 $file",
	"file_regex": "^ *\\[BetterOrder\\] (.+):([0-9]+):() (.*)$",
	"selector": "source.mql64",
	"working_dir": "$file_path"  	
}

It compiles OK, but F4 does not work.

Output of compiler looks like:

E:\Projects\MT4\BetterOrder\trunk\Experts\BetterOrder\BetterOrder.mq4 : information: Compiling 'BetterOrder.mq4'
e:\MT.DEMO\MT4\FxPro.VTS\MQL4\include\stderror.mqh : information: Including 'stderror.mqh'
e:\MT.DEMO\MT4\FxPro.VTS\MQL4\include\stdlib.mqh : information: Including 'stdlib.mqh'
e:\MT.DEMO\MT4\FxPro.VTS\MQL4\include\WinUser32.mqh : information: Including 'WinUser32.mqh'
e:\MT.DEMO\MT4\FxPro.VTS\MQL4\include\common_functions.mqh : information: Including 'common_functions.mqh'
e:\MT.DEMO\MT4\FxPro.VTS\MQL4\include\extensible_functions_header.mqh : information: Including 'extensible_functions_header.mqh'
e:\MT.DEMO\MT4\FxPro.VTS\MQL4\include\extensible_functions.mqh : information: Including 'extensible_functions.mqh'
e:\MT.DEMO\MT4\FxPro.VTS\MQL4\include\mt4logger.mqh : information: Including 'mt4logger.mqh'
E:\Projects\MT4\BetterOrder\trunk\Experts\BetterOrder\BetterOrder.mq4(12,1) : error 116: 'ss' - declaration without type
E:\Projects\MT4\BetterOrder\trunk\Experts\BetterOrder\BetterOrder.mq4(108,38) : error 256: 'MagicSeed' - undeclared identifier

Can anybody help me with correct RegEx for searching file name e.g. BetterOrder.mq4 and line e.g. 12 ?

Thank you a lot

Oligodar

0 Likes

#2

You can try something like:

^\s*(\w\:\\\.]*)\((\d+),(\d+)\)

And maybe add

\s*:\s*error\b.*$

to be sure to capture only line with error.

0 Likes

#3

Hi Clams,

Thank you for your help.

It highlights some parts, I think something in not right. And Sublime Text 3 reports: “No Build System”

0 Likes

#4

{
	"shell_cmd": "e:\\MT.DEMO\\MT4\\FxPro.VTS\\mql64.exe /mql4 $file",
	"file_regex": "^\\s*(\\w\\:\\\\.]*)\\((\\d+),(\\d+)\\)",
	"selector": "source.mql64",
	"working_dir": "$file_path"  	
}

This is working

Thank you a lot

0 Likes

#5

Sublime text 3 is really awesome !!!

0 Likes