2 ms·
Sounds like he's thinking his regex is of their allowed "set" of [A-Za-z0-9!@#$%^&*()_.-], and thinks that to support space but not at start or end, he'd need ^
by Terretta 14y ago
Sounds like he's thinking his regex is of their allowed "set" of [A-Za-z0-9!@#$%^&*()_.-], and thinks that to support space but not at start or end, he'd need ^[set][ set]{6,}[set]$, repeating his set 3 times except with a space added to the middle set. That's not accurate. He can add a space to his set, then put a not-space assertion at the start and end, like ^(?! )[ set]{8,}(?<! )$ and call it a day. (And perhaps \A and \Z instead of ^ and $ depending on what he does with new lines.)