-
-
Save SeanJA/2713425 to your computer and use it in GitHub Desktop.
| { | |
| "cmd": ["php", "-f", "$file"], | |
| /* what is this for? */ | |
| "file_regex": ".* in (.*?) on line ([0-9]*)", | |
| "selector": "source.php" | |
| } |
Beginning of string
Followed by zero or more spaces (weird syntax on that, btw)
Followed by: File "
Followed by two or more characters (even weirder syntax)
Followed by: ", line
Followed by a number
...so, it's looking for a PHP error message / warning etc. in the output, and then matching the file name and line number, presumably so it can highlight it in the editor.
Slightly more readable would be:
^ *File \"(.{2,}?)\", line ([0-9]*)
Well... it doesn't have anything to do with php (I copied it from the python one) here is the one for ruby: "file_regex": "^(...*?):([0-9]*):?([0-9]*)", which is different apparently... If I knew what it was for, I would probably change it
I think you may be on to something with this "highlighting in the output" thing: https://gist.github.com/1481511
I changed it so it better matches the output from php... I guess?
Speaking of not understanding regex, I forgot the ?.. :P
Edited comment above to add ? and remove insult to former writer of the regex ;)
Right, yes, your version does look better.
It still doesn't seem to affect anything from what I can see
Doh... rtfm http://sublimetext.info/docs/en/reference/build_systems.html
It totally does something, just not when the file is only one line.
Seriously... what is the file_regex thing for?