“Regex correspond à tout sauf” Réponses codées

Regex correspond à tout sauf

let reg = /[^charachter_to_not_match]*/
// Example
let str = '<<1,2,3>, <4,5,6>, <7,8,9>>'
//match everything but '>'
reg = /[^>]+/g // Array(3) ["<<1,2,3", ", <4,5,6", ", <7,8,9"]
//match everything but '<' and '>'
reg = /[^<>]+/g // Array(5) ["1,2,3", ", ", "4,5,6", ", ", ...]
//match anything but '<', '>', ',' and '\s' (\s=any whitespace)
reg = /[^<>,\s]+/g // Array (9) ["1", "2", ..., "9"]
POG

Regex tout sauf

//match everything but '>'
reg = /[^>]+/g
Difficult Dunlin

Réponses similaires à “Regex correspond à tout sauf”

Questions similaires à “Regex correspond à tout sauf”

Plus de réponses similaires à “Regex correspond à tout sauf” dans JavaScript

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code