Click here to Skip to main content
15,900,433 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: Anyone know if I can do this and enforce it? Pin
DerekT-P3-Jan-22 11:50
professionalDerekT-P3-Jan-22 11:50 
GeneralRe: Anyone know if I can do this and enforce it? Pin
Jacquers3-Jan-22 20:21
Jacquers3-Jan-22 20:21 
GeneralRe: Anyone know if I can do this and enforce it? Pin
Peter Shaw4-Jan-22 1:50
professionalPeter Shaw4-Jan-22 1:50 
GeneralRe: Anyone know if I can do this and enforce it? Pin
BDieser4-Jan-22 2:01
BDieser4-Jan-22 2:01 
GeneralRe: Anyone know if I can do this and enforce it? Pin
K Personett4-Jan-22 5:09
K Personett4-Jan-22 5:09 
GeneralRe: Anyone know if I can do this and enforce it? Pin
Hooga Booga4-Jan-22 5:32
Hooga Booga4-Jan-22 5:32 
GeneralRe: Anyone know if I can do this and enforce it? Pin
Kirk Wood5-Jan-22 16:54
Kirk Wood5-Jan-22 16:54 
GeneralHaha, I did it. My little mini new years resolution is complete Pin
honey the codewitch2-Jan-22 11:03
mvahoney the codewitch2-Jan-22 11:03 
So there's this to consider:

1. ba((r|a|b|c)|z+)
2. ba((r|(a|(b|c)))|z(z)*)
3. ba([ra-c]|z+)


There are 3 major algorithms for converting a state machine to a regular expression.

Of these, the cleanest is probably the state-removal method, which I've employed.

#1 is the original expression
#2 is the expression recreated from a state machine using the state removal method
#3 is the result of my new algorithm, based around the state removal method, but with improvements.

Instead of building a string expression, I built out an abstract syntax tree for my regex

After it is built, I can then do high level analysis and reduction on that expression tree.

The result is #3.

Woo! I went from not being able to solve this for years to improving on it pretty significantly.

I was hoping to get this sorted out this week, and here it is. And to think I only just solved this on Christmas eve. I'm pretty happy with this result.
Real programmers use butterflies

GeneralWho cares? Pin
stoneyowl22-Jan-22 9:33
stoneyowl22-Jan-22 9:33 
GeneralRe: Who cares? Pin
harold aptroot2-Jan-22 9:41
harold aptroot2-Jan-22 9:41 
GeneralRe: Who cares? Pin
Mike Hankey2-Jan-22 10:24
mveMike Hankey2-Jan-22 10:24 
GeneralRe: Who cares? PinPopular
Mircea Neacsu2-Jan-22 11:40
Mircea Neacsu2-Jan-22 11:40 
GeneralRe: Who cares? Pin
Super Lloyd2-Jan-22 16:51
Super Lloyd2-Jan-22 16:51 
GeneralRe: Who cares? Pin
BernardIE53172-Jan-22 16:54
BernardIE53172-Jan-22 16:54 
GeneralRe: Who cares? Pin
CodeWraith2-Jan-22 19:40
CodeWraith2-Jan-22 19:40 
JokeRe: Who cares? Pin
dan!sh 2-Jan-22 21:07
professional dan!sh 2-Jan-22 21:07 
JokeRe: Who cares? Pin
oofalladeez3433-Jan-22 3:11
professionaloofalladeez3433-Jan-22 3:11 
GeneralRe: Who cares? Pin
5teveH2-Jan-22 20:49
5teveH2-Jan-22 20:49 
GeneralRe: Who cares? Pin
dandy723-Jan-22 4:40
dandy723-Jan-22 4:40 
GeneralRe: Who cares? Pin
Maximilien3-Jan-22 1:23
Maximilien3-Jan-22 1:23 
GeneralRe: Who cares? Pin
fgs19633-Jan-22 3:16
fgs19633-Jan-22 3:16 
GeneralRe: Who cares? Pin
rnbergren3-Jan-22 3:14
rnbergren3-Jan-22 3:14 
GeneralRe: Who cares? Pin
MKJCP4-Jan-22 3:55
MKJCP4-Jan-22 3:55 
GeneralRe: Who cares? Pin
BryanFazekas4-Jan-22 6:02
BryanFazekas4-Jan-22 6:02 
General"My god, it's full of stars!" Ermmm ... No Pin
OriginalGriff2-Jan-22 7:54
mveOriginalGriff2-Jan-22 7:54 

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.


Straw Poll

Were you affected by the geomagnetic storms this past weekend?
Communication disruptions, electrified pipes, random unexplained blue-screens in Windows - the list of effects is terrifying.
  Results   487 votes