Hi,
I'm facing problem using a non greedy search. Consider the following
example
% set data "Facing problem with non greedy search"
Facing problem with non greedy search
% regexp -nocase {(.*?g)(.*)} $data junk match1 match2
1
% set match1
Facing
% set match2
%
As expected value set in match1 is 'Facing'
But match2 is set to empty string whereas I was expecting it to be set
to ' problem with non greedy search'.
Can anybody explain this.
I'm facing problem using a non greedy search. Consider the following
example
% set data "Facing problem with non greedy search"
Facing problem with non greedy search
% regexp -nocase {(.*?g)(.*)} $data junk match1 match2
1
% set match1
Facing
% set match2
%
As expected value set in match1 is 'Facing'
But match2 is set to empty string whereas I was expecting it to be set
to ' problem with non greedy search'.
Can anybody explain this.