Re: Regular expression string searching & matching

Hans-Peter Diettrich <DrDiettrich1@netscape.net>
Tue, 13 Mar 2018 10:53:05 +0100

          From comp.compilers

Related articles
[3 earlier articles]
Re: Regular expression string searching & matching clint.olsen@gmail.com (Clint O) (2018-03-08)
Re: Regular expression string searching & matching clint.olsen@gmail.com (Clint O) (2018-03-10)
Re: Regular expression string searching & matching jamin.hanson@googlemail.com (Ben Hanson) (2018-03-10)
Re: Regular expression string searching & matching jamin.hanson@googlemail.com (Ben Hanson) (2018-03-11)
Re: Regular expression string searching & matching clint.olsen@gmail.com (Clint O) (2018-03-12)
Re: Regular expression string searching & matching jamin.hanson@googlemail.com (Ben Hanson) (2018-03-12)
Re: Regular expression string searching & matching DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2018-03-13)
Re: Regular expression string searching & matching jamin.hanson@googlemail.com (Ben Hanson) (2018-03-13)
Re: Regular expression string searching & matching jamin.hanson@googlemail.com (Ben Hanson) (2018-03-13)
Re: Regular expression string searching & matching clint.olsen@gmail.com (Clint O) (2018-03-17)
Re: Regular expression string searching & matching clint.olsen@gmail.com (Clint O) (2018-03-18)
Re: Regular expression string searching & matching clint.olsen@gmail.com (Clint O) (2018-03-20)
Re: Regular expression string searching & matching clint.olsen@gmail.com (Clint O) (2018-03-22)
| List of all articles for this month |
From: Hans-Peter Diettrich <DrDiettrich1@netscape.net>
Newsgroups: comp.compilers
Date: Tue, 13 Mar 2018 10:53:05 +0100
Organization: Compilers Central
References: 18-03-016 18-03-032 18-03-034 18-03-035 18-03-041
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="59615"; mail-complaints-to="abuse@iecc.com"
Keywords: lex
Posted-Date: 13 Mar 2018 15:33:51 EDT

Am 11.03.2018 um 21:52 schrieb Ben Hanson:
>> /This/ actually worked for me (one character change):
>>
>> [/][*]([^*]|[*]+[^/])*[*]+[/]
>
> Your modified regex produces the following state machine:
>
> State: 0
> [/] -> 1
>
> State: 1
> [*] -> 2
>
> State: 2
> [^*] -> 2
> [*] -> 3


I'm just curious about the notation.
What happens if neither pattern matches?
What's the purpose of [^*] in state 2, as opposed to state 1?


DoDi



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.