“expresión regular” Código de respuesta

Usar regex en JavaScript

//Adding '/' around regex
var regex = /\s/g;
//or using RegExp
var regex = new RegExp("\s", "g");
TC5550

regex

preg_match("/^([a-zA-Z' ]+)$/","Given_Name");
Malario

regular

/[A-Z]/  : 'must contain one uppercase'

/([a-z])/  : 'must contain one lowercase'

/(\d)/  : 'must contain one number'

/(\W)/  : 'must contain one special character'
Didi Abel

Expresión regular

"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&])[A-Za-z\d$@$!%*?&]{8,10}"
Enchanting Echidna

expresión regular

/findme/
Characters \, ., \cX, \d, \D, \f, \n, \r, \s, \S, \t, \v, \w, \W, \0, \xhh, \uhhhh, \uhhhhh, [\b]	
Assertions 	^, $, x(?=y), x(?!y), (?<=y)x, (?<!y)x, \b, \B
Groups 		(x), (?:x), (?<Name>x), x|y, [xyz], [^xyz], \Number	
Quantifiers *, +, ?, x{n}, x{n,}, x{n,m}
Unicode \p{UnicodeProperty}, \P{UnicodeProperty}
javascript
let re = /findme/
let defaults = new RegExp('compiled'); 
defaults = { dotAll: false, flags: "", global: false, ignoreCase: false, falselastIndex: 0, multiline: false, source: "abc", sticky: false, unicode: false}
Pink Person

Expresión regular

Hello World as a regular expression.
Replaces everything with "Hello World".
For use with vi, sed, etc.

Search String :  ^.*$
Replace String: 'Hello World'
Doubtful Deer

Respuestas similares a “expresión regular”

Preguntas similares a “expresión regular”

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código