Why my tool output matching does not work
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
Tal Dayan
Why my tool output matching does not work
Hello,
I am trying to set CCSC PIC compiler as an external tool.
A typical error message looks like:
*** "D:\temp\test1\main.c" Line 113: Error #48: Expecting a (
My regular expression is
"\([^"]+\)"\ Line\ \([0-9]+\):
File = 1
Line = 2
Column = <none>
When I double click on the error line in the output window, Text Pad (version 4.3.1) gives the message "Cannot jump to item under the cursor".
Any idea what the problem is ?
Thanks,
Tal
I am trying to set CCSC PIC compiler as an external tool.
A typical error message looks like:
*** "D:\temp\test1\main.c" Line 113: Error #48: Expecting a (
My regular expression is
"\([^"]+\)"\ Line\ \([0-9]+\):
File = 1
Line = 2
Column = <none>
When I double click on the error line in the output window, Text Pad (version 4.3.1) gives the message "Cannot jump to item under the cursor".
Any idea what the problem is ?
Thanks,
Tal
-
Jens Hollmann
Re: Why my tool output matching does not work
Hm, it seems that you have to match the beginning of a line in your regex. So something like
^.*"\([^"]+\)" Line \([0-9]+\):
works for me. Just add ^.* in front of your regex.
Mind that you have to close the output window when changing the regex. Just restarting the tool is not enough.
HTH
Jens
^.*"\([^"]+\)" Line \([0-9]+\):
works for me. Just add ^.* in front of your regex.
Mind that you have to close the output window when changing the regex. Just restarting the tool is not enough.
HTH
Jens
-
Stephan
Re: Why my tool output matching does not work
Tal,
what I don't understand in your RegEx are the backslashes you put before the spaces.
Stephan
what I don't understand in your RegEx are the backslashes you put before the spaces.
Stephan
-
Tal Dayan
Re: Why my tool output matching does not work
Thank Jens.
It works great.
My regex was based on the IAR Assembler example in the help file. This example does not have the begining of line matching.
Tal
It works great.
My regex was based on the IAR Assembler example in the help file. This example does not have the begining of line matching.
Tal
-
Tal Dayan
Re: Why my tool output matching does not work
Looks like it works both eays (with and without the '' before the spaces).
Tal
Tal
-
Andreas
Re: Why my tool output matching does not work
As space is no special character, it is not necessary to escape it with a backslash.
But it does no harm as escaped characters are the same as unescaped characters as long as the characters are no special characters...
But it does no harm as escaped characters are the same as unescaped characters as long as the characters are no special characters...
-
Jeff Epstein
Re: Why my tool output matching does not work
My opinion is that if a character is not "special" it should never be escaped. Escaping characters that need not be, makes the Regular Expression more confusing, and really just takes advantage of the "generosity" of the language. That is, you really should be getting an error because it is invalidly formatted.
$.02
:' )
Jeffy
http://www.jeffyjeffy.com/textpad
$.02
:' )
Jeffy
http://www.jeffyjeffy.com/textpad
-
Roy Beatty
Re: Why my tool output matching does not work
It ain't often that I disagree with Jeff...
I agree that preceding everything with backslash is hard on the eyes. When hardcoding regex in Python or Perl, please do keep it clean.
However, regex is usually "disposable". Few of us save regex strings unless we're just learning it and saving an example or if the regex string is long, robust and reusable. And TextPad discourages reusability by not automating regex capture. Disposability means that most of the time the only eye offended is our own.
Also, I like being able to escape whatever I need to. (Now *there's* a double entendre!) Within a program building regex on the fly, I might need to precede a few special characters with backslash . Rather than adding complicating logic to decide which characters get escaped, it might be simpler to escape them all, without the regex engine objecting. Besides, regex is so "greedy" -- should we complain when it is "generous"?
$.02+$.02,
Roy
I agree that preceding everything with backslash is hard on the eyes. When hardcoding regex in Python or Perl, please do keep it clean.
However, regex is usually "disposable". Few of us save regex strings unless we're just learning it and saving an example or if the regex string is long, robust and reusable. And TextPad discourages reusability by not automating regex capture. Disposability means that most of the time the only eye offended is our own.
Also, I like being able to escape whatever I need to. (Now *there's* a double entendre!) Within a program building regex on the fly, I might need to precede a few special characters with backslash . Rather than adding complicating logic to decide which characters get escaped, it might be simpler to escape them all, without the regex engine objecting. Besides, regex is so "greedy" -- should we complain when it is "generous"?
$.02+$.02,
Roy
-
Jeff Epstein
-
Jeff Epstein