/^/
MediumParsing

Key=Value Pair Matcher

Write a regex that matches simple configuration lines in the form key=value, where both the key and value consist of word characters only, with exactly one equals sign and no missing sides.

//
name=John / port=8080 / debug=true / invalid key value / =novalue / key=

Test cases

  • name=Johnexpect match
  • port=8080expect match
  • debug=trueexpect match
  • invalid key valueexpect no match
  • =novalueexpect no match
  • key=expect no match
  • key==valueexpect no match