On Sat, 29 Apr 2017, Fernando Cabral wrote:
> Benoît
>
> I am prety new to Gambas, but quite an old hand with regular expression
> (almost from the time when sed, awk and vi were created. All of them allow
> heavy use of regular expression). It took me many hours to understand that,
> contrary to
Tobi, I was not aware and have been careless with the subject issue. Sorry.
As to the Regexp.Replace quirk, I found it out the hardest way: trying,
trying and trying.
Now I hope I have that knack of it. At least with the more basic
expressions.
Thank you.
- fernando
2017-04-29 8:48 GMT-03:00 To
Benoît
I am prety new to Gambas, but quite an old hand with regular expression
(almost from the time when sed, awk and vi were created. All of them allow
heavy use of regular expression). It took me many hours to understand that,
contrary to customs,
Gambas regex are ungreedy. It took me some more
Le 29/04/2017 à 16:30, Tobias Boege a écrit :
> On Sat, 29 Apr 2017, Benoît Minisini wrote:
>> Le 29/04/2017 à 13:48, Tobias Boege a écrit :
>>>
>>> Yes, admittedly it is strange behaviour of RegExp.Replace() to invert
>>> the greediness of all quantifiers and it was discovered just a few days
>>>
On Sat, 29 Apr 2017, Benoît Minisini wrote:
> Le 29/04/2017 à 13:48, Tobias Boege a écrit :
> >
> > Yes, admittedly it is strange behaviour of RegExp.Replace() to invert
> > the greediness of all quantifiers and it was discovered just a few days
> > ago. I don't know if it is going to be fixed thou
Le 29/04/2017 à 13:48, Tobias Boege a écrit :
>
> Yes, admittedly it is strange behaviour of RegExp.Replace() to invert
> the greediness of all quantifiers and it was discovered just a few days
> ago. I don't know if it is going to be fixed though. I bet there was a
> rationale behind this setting,
On Fri, 28 Apr 2017, Fernando Cabral wrote:
> Hi, gambas is new to me, but regex is not so new. But I am baffled with the
> following result:
>
> str = "A#BB##CCC###"
> print RegExp.Replace(str, "[#]+", ";")
> A;BB;;CCC;;;
> str = "A#BB##CCC###"
> print RegExp.Replace(str, "[#][#]*", ";")
>