I have a String like - \"Bangalore,India=Karnataka\". From this String I would like to extract only the substring \"Bangalore\". In this case the regex
\"Bangalore,India=Karnataka\"
\"Bangalore\"
Try this regex, This will grab any grouping of characters at the start followed by a comma but not the comma itself.
^.*(?=,)