Home Download Buy Blog Forum Support

file_regex Lookaround bug

file_regex Lookaround bug

Postby koss1024 on Tue Jul 24, 2012 5:21 pm

Hello.

I have buid tool error output lines like this.

D:\src\project\foo\tooo\file.cpp:11: error: expected constructor, destructor, or type conversion before 'char'

I want to parse them via regex like this. for example

"file_regex": ".+(?=(:[0-9]+:\\s+error:))"

After building, when pressing F4 sublime selects
"D:\src\project\foo\tooo\file.cpp"

but it opens file than somewhy is named
":11: error:"

Am I doing something wrong? Please say I'm not crasy :)
koss1024
 
Posts: 2
Joined: Tue Jul 24, 2012 5:13 pm

Re: file_regex Lookaround bug

Postby quarnster on Tue Jul 24, 2012 5:43 pm

Regex group 1,2 and 3 correspond to the filename, line and column respectively. Try something like "(.+):(\d+)"
quarnster
 
Posts: 389
Joined: Tue Nov 29, 2011 11:34 am

Re: file_regex Lookaround bug

Postby koss1024 on Wed Jul 25, 2012 8:39 am

Wow. Didn't know that!
Then what for is line_regex?

Where can this information be found? In any documentation I dind't saw a word about groups.

Thank you.

P.S. "file_regex": "(.+):(\\d+): error: .*"
Worked fine.
koss1024
 
Posts: 2
Joined: Tue Jul 24, 2012 5:13 pm


Return to Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 33 guests