[Regex Expression] Use Shorthand to Find Common Sets of Characters
to of Find use Common expression characters regex
2023-09-14 08:59:20 时间
In this lesson we'll learn shorthands for common character classes as well as their negated forms.
var str = `Afewserg, %8392 ?AWE`; var regex = /[a-zA-Z0-9]/g; // the same as: var regex = /\w/g; // Find anything but not the a-zA-Z0-9 var regex = /[^a-zA-Z0-9]/g; // the same as var regex = /\W/g; var regex = /[0-9]/g; // the same as: var regex = /\d/g; // Find anything but not the 0-9 var regex = /[^0-9]/g; // the same as var regex = /\D/g; var regex = /\s/g; // match all the space // Find anything but not the space var regex = /[^\s]/g; // the same as: var regex = /\S/g;
相关文章
- php 报错 Trying to get property of non-object 解决方案
- Spring Batch Read from DB and Write to File
- IDEA的SonarLint插件报错Unable to create symbol table for
- Cannot assign to read only property 'exports' of object '#<Object>'
- [React] When to useReducer instead of useState
- [Server Running] [Node.js, PM2] Using PM2 To Keep Your Node Apps Alive
- 2. Using 'dp' instead of 'px' to set text size
- [!Typescript] Tips: dynamic specify the type of arguments to function
- [Typescript] Tips: Use 'extends' keyword to narrow the value of a generic
- [Regex Expression] Use Shorthand to Find Common Sets of Characters
- [Javascript] Intro to Recursion - Detecting an Infinite Loop
- [FAQ] "cannot refer to unexported name" in Golang ?
- How to find documentation of given API
- How to find root cause of creation navigation failure
- How to find implementation of Requirement defined in Pricing Procedure
- A simple tool to calculate the total size of a BSP application
- How to get information of all attachments belonging to a given appointment
- How to judge if one OData model data is out of date
- how to find data source of F4 help in web client UI
- Spring源码研究之how is returned hello string converted to jsp page
- how to resolve error message java.lang.ClassNotFoundException: org.springframework
- 【Codeforces 231C】To Add or Not to Add
- ios swift:Cannot convert value of type ‘ArraySlice<UInt8>‘ to specified type ‘[UInt8]‘
- Android 高版本联网失败报错:Cleartext HTTP traffic to xxx not permitted解决方法
- 成功解决A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,co
- 转载:做正确的事情,等着被开除(Do the right thing, Wait to get fired)
- How to Configure Oracle Database to Store Archive Redo Logs into Fast Recovery Area
- How to Manage Space of The FAST RECOVERY AREA
- zookeeper连接,报caught end of stream exception EndOfStreamException: Unable to read additional data fro
- Kubernetes capacity planning: How to rightsize the requests of your cluster