1
sudhaker
For REGEX GURU
  • 2003/10/15 21:06

  • sudhaker

  • Not too shy to talk

  • Posts: 117

  • Since: 2003/2/6 2




I need to configure XOOPS so that it only allows users with format {name}{year_in_2_digit}{breanch_code}

example -> sudhaker97ec is a valid one

Followings are the list of branch code:
m, c, e, pr, me, ch, ec, mi, cs

If I'll use "\d{2}(m|c|e|pr|me|ch|ec|mi|cs)\z" in "Preferences Main »» User Info Settings »» Enter names that should not be selected as username"

this will filter users exactly what i wish to permit.

I am looking for options other than hacking register.php

Thanx.


2
sudhaker
Re: For REGEX GURU
  • 2003/10/15 21:07

  • sudhaker

  • Not too shy to talk

  • Posts: 117

  • Since: 2003/2/6 2



Can we NEGATE the regex ??

3
ackbarr
Re: For REGEX GURU

I am not strong with regular expressions, but I think negating the regex should do the trick. I'll have to pull out my copy of Mastering Regular Expressions tonight to see how to do so

4
Hober
Re: For REGEX GURU
  • 2003/11/7 23:24

  • Hober

  • Just popping in

  • Posts: 40

  • Since: 2003/6/13


Put this around line 77 of register.php
if ( !preg_match("/^.+[0-9]{2}[m|c|e|pr|me|ch|ec|mi|cs]{1}$/",$uname) ) {
  
$stop .= sprintf("Your username is not formatted correctly<br />");
}

Login

Who's Online

99 user(s) are online (74 user(s) are browsing Support Forums)


Members: 0


Guests: 99


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits