wiki/content/20201104102506-javascript_regexp_search_method.md

11 lines
206 B
Markdown
Raw Normal View History

2024-05-06 20:40:05 +00:00
---
2024-10-29 18:27:12 +00:00
date: 2020-11-04
2024-05-06 20:40:05 +00:00
id: cc0d1937-ec92-4a2f-802d-f5fbde4e61b2
title: JavaScript RegExp Search Method
---
``` javascript
console.log(" word".search(/\S/)); // 2
console.log(" ".search(/\S/)); // -1
```