regular expression to match the output - Ruby
Moderators: AmigoJack, bbadmin, helios, MudGuard
regular expression to match the output - Ruby
Hi Group,
Anyone succeeded with regular expression to match the output for Ruby?
Don't get any search hits in that regard.
Thank You,
Gary
Anyone succeeded with regular expression to match the output for Ruby?
Don't get any search hits in that regard.
Thank You,
Gary
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
error format
Thank you Ben,
error format is below, trying to extract the integer '39' on the first line, I think, is how te does it.
C:/Program Files/Ruby/work/lib/try1/domain1/recs.rb:39: syntax error
if args.size==1 then @width=args[0] end return @width
error format is below, trying to extract the integer '39' on the first line, I think, is how te does it.
C:/Program Files/Ruby/work/lib/try1/domain1/recs.rb:39: syntax error
if args.size==1 then @width=args[0] end return @width
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
thank you; getting close
thank you; not taking it yet; but will continue to try to tweak it
should have noticed that before
I might have noticed the ruby error matches java's in format.
^\(\(\(.[^:]\)\|\([A-Za-z]:\)\)[^:]+\):\([0-9]+\):
file 1
line 4
^\(\(\(.[^:]\)\|\([A-Za-z]:\)\)[^:]+\):\([0-9]+\):
file 1
line 4
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
This is the same as my suggestion, except that
1. it uses TextPad's default regular expression syntax instead of the far more readable "Posix" syntax (and it contains two pairs of redundant parentheses, increasing its unreadability), and
2. it takes unnecessary pains to ensure it doesn't match anything beginning with [^A-Z]: (anything that isn't a letter, followed by a colon).
1. it uses TextPad's default regular expression syntax instead of the far more readable "Posix" syntax (and it contains two pairs of redundant parentheses, increasing its unreadability), and
2. it takes unnecessary pains to ensure it doesn't match anything beginning with [^A-Z]: (anything that isn't a letter, followed by a colon).
Thank you
Thank you -- I wasn's getting the shorter, and as you say simpler, rgx to work (I'm sure due to my lack of fluency in rgx) so just copied in the textedit java string, which I definately can't read at this point.
When I have a moment, going to back to yours and play and see what I was doing wrong, need to regain and gain some rgx expertise.
thx much for the help
Gary
When I have a moment, going to back to yours and play and see what I was doing wrong, need to regain and gain some rgx expertise.
thx much for the help
Gary
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm