2.修饰符.html 400 B

1234567891011121314151617
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Document</title>
  7. </head>
  8. <body>
  9. <script>
  10. // g 匹配全局
  11. // i 不区分大小写
  12. const reg = /A/ig;
  13. let str = 'I have an apple and A banana';
  14. console.log(str.match(reg))
  15. </script>
  16. </body>
  17. </html>