Search code examples
javascriptregexperlpcreregex-group

Regex match after semicolon and separated comma


I have a string like

Menu: apple, orange-juice, bananas

I want to use REGEX to match only apple orange-juice bananas I have tried to search Google and regex101.com for help but still no any idea.

I would appreciate any help! Thank you


Solution

  • You can do the following in javascript :

    var string = "Menu: apple, orange-juice, bananas";
    console.log(string.replace(/Menu: |\,/g, ""))

    Regex101 : https://regex101.com/r/N0AfW7/1