vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Username regular expression (https://vborg.vbsupport.ru/showthread.php?t=181674)

Mum 06-06-2008 08:36 AM

Username regular expression
 
I am trying to change this to only accept a-z 1-9 ` ^ - _ [ ] | and no spaces.

I found ^[A-Z0-9] which i understand does a-z and 0-9 - but how can i add in those other few characters that i want?

thanks in advance

Dismounted 06-06-2008 08:51 AM

Code:

/^([ a-z0-9`\^-_\[\]\|]+)$/i

Mum 06-06-2008 09:08 PM

Thank you.

There appears to be a problem with that. I just tried to sign up as testing-all but it wouldn't accept it.

Dismounted 06-07-2008 07:02 AM

Try:
Code:

/^[ a-z0-9`\^\-_\[\]\|]+$/i

Mum 06-18-2008 10:08 PM

That doesn't seem to work either. If i use just ^[A-Z0-9] that will allow letters, numbers and NO spaces right?

RLShare 06-18-2008 10:53 PM

Shouldn't it have both A-Z and a-z to account for all uppercase and lowercase letters? I've only messed with regular expressions in Python but it seems that it should still be the same.

Eikinskjaldi 06-19-2008 12:17 AM

Quote:

Originally Posted by RLShare (Post 1553052)
Shouldn't it have both A-Z and a-z to account for all uppercase and lowercase letters? I've only messed with regular expressions in Python but it seems that it should still be the same.

the /i switch means case insensitive.

as for the regex. Quite why you would want back ticks, bars and square brackets in usernames is beyond me. is your site called www.easy.to.hack.com?

the hyphen should go unescaped at the end, I have no idea if backticks need escaping, or if they or anythig else is being weeded out by vb.

/^[ a-z0-9`\^_\[\]\|-]+$/i

or

/^[ a-z0-9\`\^_\[\]\|-]+$/i

are my guesses


All times are GMT. The time now is 01:22 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00962 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete