Answer the question
In order to leave comments, you need to log in
How to find two substrings in a string using regex?
Line: I hate regular expressions
I need a regular expression that will look for the words hate and expressions in the given string.
For example, match should return an array of ["hate", "expressions"], or any other method that will return, for example, true if both words are found, or false if not found.
//я пробовал вот так и еще много как (начиная с 10 утра), но так и не получилось :(
let str = 'I hate regular expressions',
regexp = /hate expressions/gi;
str.match(regexp);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question