Re: Reguar expression - what with *




Helmut Richter napisal(a):
On Wed, 8 Nov 2006, pgn@xxxxxxxxx wrote:

1. I have a regular expr. like this: (( a+b )a* )* and I'm trying to
describe it, and it's like this in my opinion: at the very beginning
language generated by this regular expr. has 'a' or 'b' and then
multiple of 'a' (empty, a, aa...). And now my question what about the
last '*' sign? How to write it down?

Take any string over the alphabet {a, b}, e.g.

baabbababaabbbababbbabab

Now cut it into pieces just before each occurrence of b:

baa b ba ba baa b b ba ba b b ba ba b

Which of the pieces does not belong to the language (a+b)a* ?
What can be concluded for the language ((a+b)a*)* ?

All of the pieces belongs to the language, I think. Because at the
beggining we have b (a+b means a or b - so that is correct) and then we
can have zero or more times a.
So for the language ((a+b)a*)* we can have: a or b then zero or more
times a and all of this zero or more times.
Am I right?

Regards,
Pi

.



Relevant Pages

  • Re: Forth Frustrations
    ... *all* words consume zero or more items on the stack and return zero or more items. ... it clearly describes the language and says little if anything about the underlying implementation. ... The language offers words that only ever consume and leave items on the stack. ... The model I would use to implement LSE64 in Standard Forth is to construct a thin portability layer. ...
    (comp.lang.forth)
  • Re: Forth Frustrations
    ... *all* words consume zero or more items on the stack and return zero or more items. ... it clearly describes the language and says little if anything about the underlying implementation. ... I'm not sure how this relates to my description of Tester. ... I would first create a thin portability layer and express the swap in terms of that layer, ...
    (comp.lang.forth)
  • Re: May the Fourth be with you
    ... Pick zero ... I'm an above-average programmer, but hardly unique. ... Employers are looking for someone younger. ... programming language. ...
    (rec.arts.sf.fandom)
  • Re: Setting based 1 Arrays
    ... However after the inconsistancies of vb6 I'm quite happy to have everything in zero based if it's consistant. ... For BASIC-like language, in principal these are based 1 indexing. ... VB.net developers might accept 1 based arrays but C# developers will be anything from annoyed to outraged. ... I am 100% sure that he will want to re-use some of the WCC code in his VB.NET code. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Forth Frustrations
    ... implementation simplicity is paramount because the code has to be as ... viewpoint there is no "input buffer": there is only language. ... words consume zero or more items on the stack and return zero or more ... way to encode intent. ...
    (comp.lang.forth)