Customizing SMF > SMF Coding Discussion

Profile Field Input Mask (Regex)

<< < (2/6) > >>

The Craw:
Oh, whoops. LOL

Well this presents a bit of a challenge, but we should be able to disallow "face( )book" with what they call a  negative look-around. Try this.


--- Code: ---^((?!face( )?book).)*$

--- End code ---

Make sure you test it out and let me know if it works as expected. ;)

Jade Elizabeth:
Thank you!

Going to test it now, but is there a way to make it change to say no one with the input mask field?

Jade Elizabeth:
Doesn't work, I think it's making the field valid only if it has facebook in it somehow?

The Craw:
Hmm, yeah I dunno what the problem is, unfortunately. Being that the mask appears to limit the field to what can be used, and not what can't, I'm not really sure what you can do. At least not without digging into the codez a little bit.

emanuele:
Try:

--- Code: ---~^((?!.*\b(facebook|face)\b))~
--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version