Created
October 8, 2014 12:25
-
-
Save kumpelblase2/49c38f93ca8339a9c33a to your computer and use it in GitHub Desktop.
This is a regex expression to parse the graphs given to us in an assignment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
^([a-zA-Z0-9]+) ?(-(>|-) ?([a-zA-Z0-9]+) ?(\(([a-zA-Z0-9]+)\))?)? ?( ?: ?([0-9]+))?;$ | |
This parses the following kinds of (undirectional) graphs: | |
a -> b; | |
a ->b; | |
a-> b; | |
a -- b; | |
b--a; | |
a -> b(my_name); | |
a -> b (my_name); | |
a -> b : 10; | |
a -> b:2020202; | |
a -> b (my_name) : 51; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment