Path: news.cs.au.dk!not-for-mail From: "Sascha Kimmel" Newsgroups: comp.lang.beta Subject: RE: REGEXP not doing anything! Date: 10 Jun 1999 09:05:24 -0000 Organization: University of Aarhus, Department of Computer Science (DAIMI) Lines: 98 Approved: mailtonews@cs.au.dk Distribution: world Message-ID: <19990610090524.22112.qmail@noatun.mjolner.dk> Reply-To: "Sascha Kimmel" NNTP-Posting-Host: daimi.cs.au.dk X-Trace: xinwen.cs.au.dk 929005543 4418594 255.255.255.255 (10 Jun 1999 09:05:43 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 10 Jun 1999 09:05:43 GMT Xref: news.cs.au.dk comp.lang.beta:11989 Hi! Thank you for your quick reply. But to say it directly: Mjolner has made this bug, too because the first example is taken out of the Basic Libraries Documentation (mia90-08.pdf) and there no t.reset can be found. Maybe Mjolner could fix this in newer versions of the documentation? :) Thanks again. Regards, Sascha Kimmel > -----Original Message----- > From: Jorgen Lindskov Knudsen [mailto:jlk@cs.au.dk] > Sent: Thursday, June 10, 1999 10:17 AM > To: usergroup@mjolner.dk > Subject: Re: REGEXP not doing anything! > > > You have made the same bug in both examples. The problem is > not relatet to > regexp, but the fact, that text variables in BETA contains > the notion of > position within the text, and most text operations work 'from > the current > position' in the text. When texts are initialized by statements like: > 'Hello world'->t[] > then the position will be at the very end of the text, and > the following > regexp_replace operation will try to replace in the string from that > position - since thaat is at the end of the string, no match > will be found > (and the noMatch virtual will in fact be invoked). > > In your examples, just insert > t.reset > as in: > 'Hello world'->t[]; t.reset > than everything will work as you expect. > > Regards, > > Jørgen Lindskov Knudsen > > Sascha Kimmel wrote in message > <19990610073958.20891.qmail@noatun.mjolner.dk>... > >Hi! > > > >I want to use the regexp fragment for parsing purposes, but even your > >simplest demo program (p. 86 in mia90-08.pdf) does not work with BETA > >4.1: > > > >ORIGIN '~beta/basiclib/v1.6/betaenv'; > >INCLUDE '~beta/basiclib/v1.6/regexp'; > > > >-- program: descriptor -- > > > >(# > > t:^text; > > do > > 'Hello world' -> t[]; > > ('\\', '\\0 champion') -> t.regexp_replace; > > t[] -> putline; (* prints 'Hello world champion' *) > >#) > > > > > >This program just produces a "Hello world" and not "Hello world > >champion". > >The very very simple > > > >ORIGIN '~beta/basiclib/v1.6/betaenv'; > >INCLUDE '~beta/basiclib/v1.6/regexp'; > > > >-- program: descriptor -- > > > >(# > > t:^text; > > do > > 'Hello BETA!' -> t[]; > > ('BETA', 'Mjolner') -> t.regexp_replace; > > t[] -> putline; (* should print 'Hello Mjolner!' *) > >#) > > > >only gives me a "Hello BETA!" and not the string that should > be there. > > > >Is the regexp fragment working in some way? > > > >Any quick help is appreciated. > > > >Regards, > >Sascha Kimmel > > > > >