Click here to Skip to main content
15,887,135 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: ...to help new "customer service " employee... Pin
k505419-Jan-24 13:10
mvek505419-Jan-24 13:10 
GeneralRe: ...to help new "customer service " employee... Pin
Greg Utas19-Jan-24 14:03
professionalGreg Utas19-Jan-24 14:03 
GeneralRe: ...to help new "customer service " employee... Pin
Nelek19-Jan-24 21:36
protectorNelek19-Jan-24 21:36 
GeneralRe: ...to help new "customer service " employee... Pin
obermd20-Jan-24 8:37
obermd20-Jan-24 8:37 
GeneralRe: ...to help new "customer service " employee... Pin
jschell23-Jan-24 6:14
jschell23-Jan-24 6:14 
GeneralRe: ...to help new "customer service " employee... Pin
Gerry Schmitz19-Jan-24 14:54
mveGerry Schmitz19-Jan-24 14:54 
GeneralRe: ...to help new "customer service " employee... Pin
Peter Kelley 202122-Jan-24 4:51
Peter Kelley 202122-Jan-24 4:51 
GeneralMaking two lines of code work took years of effort but I finally did it! PinPopular
honey the codewitch19-Jan-24 5:27
mvahoney the codewitch19-Jan-24 5:27 
C#
var nfa = FA.Parse(@"(foo|(bar)+|ba[rz])|foobar");
Console.WriteLine(nfa.ToString("e"));

Terminal
(bar|barba(rba)*r|baz|foo|foobar)


It was always the loops that would just nail me to the wall.

I still have to clean up the expressions it produces but they are essentially correct!

I used the state removal method[^] but I couldn't find an adequate explanation.

Finally, I found this: GitHub - wolever/nfa2regex: Converts NFAs (and DFAs) to a regular expressions using the state removal method.[^]

It's in Go, so I taught myself some Go Smile | :) Not a bad language in that it only took me a few hours from start to finish to learn enough of it and port away from it to C#.

Unfortunately when I think I am too smart for my own good I used to try to do this algorithm to remind me of my intellectual shortcomings - I no longer have that opportunity. Laugh | :laugh: I guess I'll have to try LL(k) or LL(*) parsing next. The trouble with that is parser generators aren't usually good enough to make real world parsers, or the code they generate is too big. Oh well. I'll find something.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix

GeneralRe: Making two lines of code work took years of effort but I finally did it! Pin
pkfox19-Jan-24 9:45
professionalpkfox19-Jan-24 9:45 
GeneralRe: Making two lines of code work took years of effort but I finally did it! Pin
Nelek19-Jan-24 10:13
protectorNelek19-Jan-24 10:13 
GeneralRe: Making two lines of code work took years of effort but I finally did it! Pin
honey the codewitch19-Jan-24 10:25
mvahoney the codewitch19-Jan-24 10:25 
GeneralRe: Making two lines of code work took years of effort but I finally did it! Pin
Nelek19-Jan-24 21:37
protectorNelek19-Jan-24 21:37 
GeneralRe: Making two lines of code work took years of effort but I finally did it! Pin
jschell22-Jan-24 6:18
jschell22-Jan-24 6:18 
GeneralRe: Making two lines of code work took years of effort but I finally did it! Pin
honey the codewitch22-Jan-24 6:19
mvahoney the codewitch22-Jan-24 6:19 
GeneralWatch Japan's moon lander PinPopular
Marc Clifton19-Jan-24 4:06
mvaMarc Clifton19-Jan-24 4:06 
GeneralRe: Watch Japan's moon lander Pin
Jeremy Falcon19-Jan-24 6:57
professionalJeremy Falcon19-Jan-24 6:57 
GeneralRe: Watch Japan's moon lander Pin
k505419-Jan-24 7:03
mvek505419-Jan-24 7:03 
GeneralRe: Watch Japan's moon lander Pin
Jeremy Falcon19-Jan-24 7:07
professionalJeremy Falcon19-Jan-24 7:07 
GeneralRe: Watch Japan's moon lander Pin
Richard Andrew x6419-Jan-24 11:39
professionalRichard Andrew x6419-Jan-24 11:39 
GeneralRe: Watch Japan's moon lander Pin
Jeremy Falcon22-Jan-24 4:49
professionalJeremy Falcon22-Jan-24 4:49 
GeneralRe: Watch Japan's moon lander Pin
jschell22-Jan-24 6:19
jschell22-Jan-24 6:19 
JokeRe: Watch Japan's moon lander Pin
PIEBALDconsult19-Jan-24 12:11
mvePIEBALDconsult19-Jan-24 12:11 
GeneralRe: Watch Japan's moon lander Pin
Vikram A Punathambekar20-Jan-24 5:13
Vikram A Punathambekar20-Jan-24 5:13 
GeneralRe: Watch Japan's moon lander Pin
trønderen19-Jan-24 13:07
trønderen19-Jan-24 13:07 
GeneralRe: Watch Japan's moon lander Pin
Richard Andrew x6419-Jan-24 14:24
professionalRichard Andrew x6419-Jan-24 14:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.