Yngvarr

Generation

generate functionFri, 14 Apr 2023

pregmatch array in string

let languages = "Java, Python, Javascript, C#, C++"; let pattern = /C#|C\+\+|C++/; let result = pattern.test(languages); if(result) { console.log("Yes, it is in the list"); }

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant