“expression régulière” Réponses codées

Utilisation de Regex en JavaScript

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

expirat

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

expansion excitée

/[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

Expression régulière

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

expression régulière

/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

Expression régulière

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

Réponses similaires à “expression régulière”

Questions similaires à “expression régulière”

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code