intersecting_regular_expressions



intersecting_regular_expressions

0 0


intersecting_regular_expressions


On Github ehrenmurdick / intersecting_regular_expressions

Ehren Murdick

@rubyprogrammer

github.com/ehrenmurdick

Regular Expressions

a sequence of characters that define a search pattern, mainly for use in pattern matching with strings, or string matching, i.e. "find and replace"-like operations1

How they work

"foobar"

/b.r/

nerd snipe2

To provide a problem so interesting and difficult that the target is compelled to cease whatever they are doing (eating, reading, walking) in order to think about it

Can you detect if two regular expressions intersect?

/a../ /.bc/ "abc" /a../ /a+c/ "aac" /a*b{1, 2}/ /b{2,}c+/ "bbc"

You can!

With state machines!

/b{2,}c+/

/a*b{1, 2}/

/b{2,}c+/

/a*b{1, 2}/

/bbc/

Links

wikipedia explainxkcd.com
Ehren Murdick @rubyprogrammer github.com/ehrenmurdick