Projects > Regular Expression

Home Projects Challenges

Regular Expression


May 31, 2021 | Learning JS

Regular Expression, a.k.a regex, is used to help programmers to find, match, search, replace the text. So what I learn so far?

If this "text" exists in the variable

        
          let sentence = "ImBeginnerJS"; 
          let searchText = /JS/; // What you want to find
          searchText.test(sentence); // Return T or F
        
        
          searchText = /JS|gin|Im/; // | means or
          searchText.test(sentence);
          
        

↤ Go Back

Updated in May 31, 2021
Gmail | Proton | LinkedIn | Github
Alright reserved 2021