Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What are the common regular expression matching codes?

Shulou Source: shulou.com Published: 2022-06-02 03:55:37 10月02日 Update

This article mainly introduces the commonly used regular expression matching code, the article is very detailed, has a certain reference value, interested friends must read it!

Regular expression, also known as regular representation, conventional representation. (English: Regular Expression, often abbreviated as regex, regexp or RE in code), a concept in computer science. Regular expressions use a single string to describe and match a series that conforms to a syntactic rule. In many text editors, regular expressions are often used to retrieve and replace text that matches a certain pattern.

/ * RMB amount check * / var testRMB = function (v) {var reg = / ^ ([1-9] [\ d] {0rem 7} | 0) (\. [\ d] {1J 2})? $/; return reg.test (v); / / 12345678.12} / * positive integer check * / var testZZS = function (v) {var reg = / ^ [0-9] * [1-9] [0-9] * $/; return reg.test (v) / / 12345678.12} above is all the content of the article "what are the matching codes for regular expressions in common use?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Regular expression code common use content text article representation Zhong Chang regular people RMB value interest single also known as syntax character string boy Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Docker MySQL vpn Shulou Technology