freeCodeCamp/guide/chinese/javascript/tutorials/invert-regular-expression-m.../index.md

7 lines
271 B
Markdown

---
title: Invert Regular Expression Matches with JavaScript
localeTitle: 使用JavaScript反转正则表达式匹配
---
使用`/\S/gi` ;匹配字符串中不是空格的所有内容。
您可以通过使用选择的大写版本反转任何匹配`\s`与`\S`的例子。