I am new to regular expressions, however, I managed to figured out one for Lahey fortran yesterday, but for some reason it got deleted overnight, and now I can't recall it.
Error codes look like this:
Compiling program unit test01 at line 1:
2018-S: "test.for", line 7: When IMPLICIT NONE is specified, x must be declared in a type declaration statement.
Encountered 1 error, 0 warnings in file test.for.
This does not work:
^.+"\([:alpha:]+\)".+\([:digit:]+\)
File=1
Line=2
What am I doing wrong?
RegEx for Lahey Fortran
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Code: Select all
^[^"]*"([^"]+)", line ([0-9]+):
What it does:
^
start at the beginning
[^"]*
any number of non-quotes
"
the first quote, starting the file name
([^"]+)
any number of non-quotes (will be remembered) - the file name
"
the second quote, finishing the file name
, line
the stuff between file name and line number
([0-9]+)
any number of digits (the line number, will be remembered).
:
the colon after the line number
[:alpha:] allows one of the characters ":", "a", "l", "p", "h".
[:alpha:] can be used within a character class, i.e. within [].
(similar for [:digit:] and the other character class operators).
But even [[:alpha:]] would not work, as your filename contains other characters than letters (e.g. the dot).
-
- Posts: 5
- Joined: Fri Apr 21, 2006 3:42 pm