Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ JavaScript: understanding regular expressions     - grep command Series: How to Use the grep command in Linux / UNIX (Linux)

- Nginx Performance Tuning Guidelines (Server)

- Use small network command to check whether PC Security (Linux)

- Ubuntu: HDF5 error: HDF5 header version does not match with the HDF5 library (Linux)

- Magical Virtualbox under Ubuntu (Linux)

- Linux start the process (Linux)

- Macro Analysis Performance: PHP Performance Analysis and Experiment (Programming)

- How to restart after a crash Cinnamon (Linux)

- How to use tmpfs in RHEL / CentOS 7.0 (Linux)

- Linux environment to configure Apache + Django + wsgi (Server)

- Deploy OpenStack Juno on Ubuntu 14.04 (Linux)

- On event processing browser compatibility notes (Programming)

- Ubuntu in Vim editor display processing method Chinese garbled (Linux)

- Oracle conditional select statements and looping statements (Database)

- Django1.8 return json json string and the string contents of the received post (Programming)

- MariaDB 10.0.X, the dynamic column support JSON format to obtain data (Database)

- Xshell key authentication mechanism using a remote login Linux (Linux)

- Ubuntu system safe and caution sudo su command (Linux)

- RHEL7.0 environment Linux kernel upgrade (Linux)

- Upload the project to GitHub, synchronous remote repository Github (Linux)

 
         
  JavaScript: understanding regular expressions
     
  Add Date : 2018-11-21      
         
         
         
  Use :( Here are some important use metacharacters)

\ S whitespace characters: a space character, \\ s: a plurality of spaces, \\ s +: a plurality of spaces

\ T tab ( '\ u0009')

\ N new line (line feed) character ( '\ u000A')

\ R carriage return ( '\ u000D')

\ F feed character ( '\ u000C')

\ A alert (bell) character ( '\ u0007')

\ B matches a word boundary (located to find a word beginning or end of the match)

\ D: to match the numbers from 0 to 9;

\ W: to match letters, numbers, or the underscore character (a-zA-Z0-9_)

\ E escape character ( '\ u001B')

\ Cx The control character corresponding to x

\ U00A9 is Unicode character

: Match all characters except newline

(To match all characters except newline)

Match string:

var s = 'abc efg';

var r = s.match (/ absc / ig); // => get absc

Convert a string:

s.replace (r, '1') // => var s = '1 efg' successfully replaced

egrep metacharacters

Matches any single character

. Dot matches any single character

[...] Character class matches a single character listed

[^ ...] Negated character set matches a single character that is not listed

Yuan character count feature

? The question mark matches the time allowed, but not necessarily

* The asterisk matches any number of times, it may not match

+ Plus at least one match, at least as many times as possible

{Min, max} interval quantifier requires at least min and at most max times allowed

Metacharacter matches the location

Caret ^ matches the beginning of a line position

$ Dollar sign matches the end position line

\
\> End of a word delimiter matching words

Other characters

| Alternation matches any partition expression

Chinese Regular: / ^ [\ u4E00- \ u9FA5] + $ /
     
         
         
         
  More:      
 
- Installation and Configuration Munin monitoring server on Linux (Server)
- Ubuntu iptables prevent IP attacks (Linux)
- Zabbix configuration of SNMP (Server)
- Why use Docker (Programming)
- Changes in C # asynchronous programming model (Programming)
- How to Install Android Studio on Ubuntu 15.04 / CentOS7 (Linux)
- Json data with double backslashes to a single backslash Json data processing (Programming)
- Android system source code and compile the kernel source code (Programming)
- Detailed Linux platform chip programming process (Programming)
- Linux more efficient than select a model epoll (Linux)
- Getting Started with Linux system to learn: how to configure a static IP address for CentOS7 (Linux)
- To compile and install Redis Linux and master-slave replication configuration (Database)
- CentOS7 minimized installation can not find the 'ifconfig' command - Repair Tips (Linux)
- Customize the output format in Linux history (Linux)
- Bash code injection attacks through a special environment variable (Linux)
- 14 useful example Linux Sort command (Linux)
- Java logging performance of those things (Programming)
- 20 Linux commands interview questions and answers (Linux)
- ARP Linux-related operations (Linux)
- Linux screen command (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.