lundi 5 octobre 2020

regex input path string [duplicate]

Hey so im new to Regex but what im basically trying to do is have the user input a path and just check if my current string contains any matching paths. So for example

Paths = "/cookie /cookie/iceCream /"
rexexInput = "/coo"

if(paths.match(regexInpute))
  //do something
end

so basiaclly just checking if the user input path is contained within the string

Aucun commentaire:

Enregistrer un commentaire