Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
/a*/ // 0 or more "a" /a+/ // 1 or more "a" /a?/ // 0 or 1 "a" (optional) /a{3}/ // exactly 3 "a" /a{2,4}/ // 2 to 4 "a" /a{2,}/ // 2 or more "a" // Greedy vs lazy /".+"/ // Greedy: matches as much as possible /".+?"/ // Lazy: matches as little as possible "say \"hi\" and \"bye\"".match(/".+"/g); // ["\"hi\" and \"bye\""] greedy "say \"hi\" and \"bye\"".match(/".+?"/g); // ["\"hi\"", "\"bye\""] lazy
Result
Open