Examples

{
  "states": [
    "Q1",
    "Q2"
  ],
  "initialState": "Q1",
  "finalStates": [
    "Q2"
  ],
  "inputSymbols": [
    "a",
    "b"
  ],
  "transitions": {
    "Q1": {
      "a": "Q2",
      "b": "Q1"
    },
    "Q2": {
      "a": "Q2",
      "b": "Q2"
    }
  }
}
dfa

a+

Accepts strings that contains atleast one a, over the alphabet {a, b}

{
  "states": [
    "Q0",
    "Q1",
    "Q2",
    "Q3",
    "Q4"
  ],
  "initialState": "Q0",
  "finalStates": [
    "Q0"
  ],
  "inputSymbols": [
    "1",
    "0"
  ],
  "transitions": {
    "Q0": {
      "0": "Q0",
      "1": "Q1"
    },
    "Q1": {
      "0": "Q2",
      "1": "Q3"
    },
    "Q2": {
      "0": "Q4",
      "1": "Q0"
    },
    "Q3": {
      "0": "Q1",
      "1": "Q2"
    },
    "Q4": {
      "0": "Q3",
      "1": "Q4"
    }
  }
}
dfa

Divisible by 5

Accepts binary strings that are divisible by 5

{
  "states": [
    "q0",
    "q1",
    "q2",
    "q3"
  ],
  "initialState": "q0",
  "finalStates": [
    "q0",
    "q1",
    "q2",
    "q3"
  ],
  "inputSymbols": [
    "a",
    "b",
    "d",
    "c"
  ],
  "transitions": {
    "q0": {
      "a": "q0",
      "b": "q1",
      "d": "q2",
      "c": "q3"
    },
    "q1": {
      "b": "q1",
      "d": "q2"
    },
    "q2": {
      "d": "q2"
    },
    "q3": {
      "c": "q3",
      "d": "q2"
    }
  }
}
dfa

a*(b* + c*)d*

Accepts strings that contains atleast zero or more a OR zero or more b OR zero or more c followed by zero or more d, over the alphabet {a, b, c, d}

{
  "states": [
    "A",
    "B",
    "C"
  ],
  "initialState": "A",
  "finalStates": [
    "A",
    "B",
    "C"
  ],
  "inputSymbols": [
    "a",
    "b"
  ],
  "transitions": {
    "A": {
      "a": "B",
      "b": "C"
    },
    "B": {
      "a": "B"
    },
    "C": {
      "b": "C"
    }
  }
}
dfa

a* + b*

Accepts strings that contains atleast zero or more a OR zero or more b, over the alphabet {a, b}