Morbid's Grand Regex Adventure of UNTOLD DOOM AND HORROR!

MorbidEwok

EGO Zealot
Okay so I just spent the last hour or so trying to figure out a regex thing for an Extended User Field that allows users to input their steamids...

However....

The problem I had was getting the Extended User Field to only accept a certain format for steamIDs.... So... I dug through a bunch of tutorials and figured out a Regex code that allows anyone to put in a SteamID and have it verify that it is the correct format.

IE:
STEAM_0:0/1:1-8Digits

I have tested it and it DOES work :D

Regex Code for anyone who wants to use it for e107!

http://www.toxicfury.net/tutorials/regex/regex1

Note: Got the problem fixed and you just click the link and it opens up a page with just simple courier new text, ripe for copying and pasting. :p

_________________________________________________________________________


No it's basically a verification system for an user field. Lets say the EGO Forums had a setting to add your steamIDs to your profile so everyone can see them next to your name...

Example:
Outbreak
[Avatar]
**********************************************************************
Joined: Mon Jul 24 2006, 11:30PM
Location: Lakeport, CA
Steam_0:0:00000000
Posts: 3876

Okay so we'll assume the EGO Forums have a system like that and a few people are going around putting jibberish into their SteamID field in settings, coming out like this example:

Morbid
[Avatar]
******
Registered Member #957
Joined: Mon Jun 18 2007, 09:37AM
Location: Ceres, California
I ATE YOUR SOXHAHAHAH
Posts: 525

To stop this we use Regex Validation Code. What it does is check the information entered into a Text Box which is used to submit information to a field in a users table in the MYSQL database.

So...

If I typed "I ATE YOUR SOXHAHAHAH" into my userfield and there was a Regex Validation Code, then clicked submit, the browser would come back with the error message "Please use this format: STEAM_0:x:xxxxxxxx" This would not allow me to save my settings and have to reenter the correct information in the correct format.

This means I'd have to input something like these for it to actually allow me to enter any information into the mysql database.

STEAM_0:1:0123
STEAM_0:1:0153434
STEAM_0:1:53432532
STEAM_0:0:53432532

Example Image of Extended User Field and Regex in e107 Admin Area:
regexpage.png
 
No it's basically a verification system for an user field. Lets say the EGO Forums had a setting to add your steamIDs to your profile so everyone can see them next to your name...

Example:
Outbreak
[Avatar]
**********************************************************************
Joined: Mon Jul 24 2006, 11:30PM
Location: Lakeport, CA
Steam_0:0:00000000
Posts: 3876

Okay so we'll assume the EGO Forums have a system like that and a few people are going around putting jibberish into their SteamID field in settings, coming out like this example:

Morbid
[Avatar]
******
Registered Member #957
Joined: Mon Jun 18 2007, 09:37AM
Location: Ceres, California
I ATE YOUR SOXHAHAHAH
Posts: 525

To stop this we use Regex Validation Code. What it does is check the information entered into a Text Box which is used to submit information to a field in a users table in the MYSQL database.

So...

If I typed "I ATE YOUR SOXHAHAHAH" into my userfield and there was a Regex Validation Code, then clicked submit, the browser would come back with the error message "Please use this format: STEAM_0:x:xxxxxxxx" This would not allow me to save my settings and have to reenter the correct information in the correct format.

This means I'd have to input something like these for it to actually allow me to enter any information into the mysql database.

STEAM_0:1:0123
STEAM_0:1:0153434
STEAM_0:1:53432532
STEAM_0:0:53432532

Example Image of Extended User Field and Regex in e107 Admin Area:
regexpage.png
 
Back
Top