
🥑 Developer Avocado | 🐍 Python & 🐘 PHP Full Stack | 🚀 AWS Pro | Sharing open-source & dev tips @ https://teapawt.net/t.co/20ViKKwjvf | Follow for tech insights!
- Tweets1.1K
- Following1.3K
- Followers224
- Likes191
!["abc".match(/./) // . => any char "abc".match(/b/) // b => must be present "abc".match(/ab/) // ab => must be present "abc".match(/a|z/) // a|z => a or z must be present "abc".match(/z*/) // z* => 0 or more times "abc".match(/z+/) // z+ => 1 or more times "abc".match(/z?/) // z? => 0 or 1 times "abc".match(/(ab)/) // () => group, ab should present "zta".match(/[ab-e]/) // match any char a, b, c, d, e "ztf".match(/[^ab-e]/) // NOT any char a, b, c, d, e "ab5".match(/\d/) // \d => one digit "ab5".match(/\D/) // \D => one non-digit "355".match(/\D/) // fail bcoz all are digits "ab c".match(/\s/) // \s => one whitespace "ab c".match(/\S/) // \S => one non-whitespace " ".match(/\S/) // fail bcoz only whitespace "abcd".match(/\w/) // \w one word char "ab cd".match(/\w/) // \w non word char fine "abcd".match(/\W/) // \W => fail not a non-word char "ab cd".match](https://pbs.twimg.com/media/EfBhh73U4AE-nBN.jpg?name=small&format=webp)
ALT "abc".match(/./) // . => any char "abc".match(/b/) // b => must be present "abc".match(/ab/) // ab => must be present "abc".match(/a|z/) // a|z => a or z must be present "abc".match(/z*/) // z* => 0 or more times "abc".match(/z+/) // z+ => 1 or more times "abc".match(/z?/) // z? => 0 or 1 times "abc".match(/(ab)/) // () => group, ab should present "zta".match(/[ab-e]/) // match any char a, b, c, d, e "ztf".match(/[^ab-e]/) // NOT any char a, b, c, d, e "ab5".match(/\d/) // \d => one digit "ab5".match(/\D/) // \D => one non-digit "355".match(/\D/) // fail bcoz all are digits "ab c".match(/\s/) // \s => one whitespace "ab c".match(/\S/) // \S => one non-whitespace " ".match(/\S/) // fail bcoz only whitespace "abcd".match(/\w/) // \w one word char "ab cd".match(/\w/) // \w non word char fine "abcd".match(/\W/) // \W => fail not a non-word char "ab cd".match

ALT //single element defined by id const app = document.getElementById('app') //multiple elements(arrays) defined by class name const hero = document.getElementsByClassName('hero') //multiple elements based on html tag const h1 = document.getElementsByTagName('h1') //first element based on selector const hero = document.querySelector('.hero') //multiple elements based on selector const heroes = document.querySelectorAll('.hero') //create html element of tag <p> let para = document.createElement('p') //create text node let text = document.createTextNode('I ❤️ it') //add text node to the para element para.appendChild(text) //insert h2 before h1 app.insertBefore(h2, h1)





































