Path: csiph.com!3.us.feeder.erje.net!feeder.erje.net!news.linkpendium.com!news.linkpendium.com!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Clint O Newsgroups: comp.compilers Subject: Re: Regular expression string searching & matching Date: Sun, 18 Mar 2018 19:23:22 GMT Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com Lines: 61 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <18-03-074@comp.compilers> References: <18-03-016@comp.compilers> <18-03-032@comp.compilers> <18-03-034@comp.compilers> <18-03-035@comp.compilers> <18-03-041@comp.compilers> <18-03-045@comp.compilers> <18-03-054@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="60502"; mail-complaints-to="abuse@iecc.com" Keywords: lex, DFA Posted-Date: 19 Mar 2018 07:11:13 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:2012 On 2018-03-13, Ben Hanson wrote: > I'd be interested to see your DFA output once you've cleaned it up a bit. > Using derivatives is interesting too - I've seen it discussed but never tried > to get into that. Let's try this again: +--- | +--- | | +--- | | | +--- | | | `--- | | `--- | | `--- | | +--- | | `--- | | +--- | | | `--- | | `--- | `--- | `--- `--- q0: /B7[*]B7([^*] | [*]+B7[^/])*B7[*]+B7/ [/] q2 ['\x00'-.0-C?] q1 q1: b ['\x00'-C?] q1 q2: [*]B7([^*] | [*]+B7[^/])*B7[*]+B7/ [*] q3 ['\x00'-)+-C?] q1 q3: ([^*] | [*]+B7[^/])*B7[*]+B7/ [*] q4 ['\x00'-)+-C?] q3 q4: ([*]*B7[^/]B7([^*] | [*]+B7[^/])*B7[*]+ | [*]*)B7/ [*] q6 ['\x00'-)+-.0-C?] q3 [/] q5 q5: N5 ['\x00'-C?] q1 q6: (([*]*B7[^/] | N5)B7([^*] | [*]+B7[^/])*B7[*]+ | [*]*)B7/ [*] q8 ['\x00'-)+-.0-C?] q3 [/] q7 q7: ([^*] | [*]+B7[^/])*B7[*]+B7/ | N5 [*] q4 ['\x00'-)+-C?] q3 q8: ((([*]*B7[^/] | N5)B7([^*] | [*]+B7[^/])* | [*]*B7[^/]B7([^*] | [*]+B7[^/])*)B7[*]+ | [*]*)B7/ [*] q8 ['\x00'-)+-.0-C?] q3 [/] q7 Total DFA states: 9 Total RE instances: 35 So, q5, q7 are accepting states because they contain epsilon (empty string). Thanks, -Clint