Finally after many trials, I think I found an answer : ^(?=((?i)(?!private).(?-i))*$)([\w]+([_\s]{1}[a-zA-Z0-9]+))*$ Bye
U
User 1567210
@User 1567210
Posts
-
Problem combining REGEX expressions -
Problem combining REGEX expressionsHello all, I'm a regex newbie and I'm stuck with regex in PCRE/PHP. First expression, I'd like to match letters, numbers or underscore but - no space at start or end - no more than one consecutive space This works fine : ^[\w]+([_\s]{1}[a-zA-Z0-9]+)*$ Second expression - no "private" in lower or upercase ie avoid "private", "PRIVATE", "Private" ou "pRivATe" This seem to work fine : ^((?i)(?!private).(?-i))*$ I tried to combine both regex but cannot get it work ! By the way, I'm using extendsclass.com online tester. Thanks for help.
JLO