vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   help with Regular Expression (https://vborg.vbsupport.ru/showthread.php?t=275038)

demo7up 12-04-2011 08:19 PM

help with Regular Expression
 
I need something like this
Code:

^([1-9]|[1-4][0-9]|50)$
but to only allow 6 chars but only numbers and letters thanks

LifesGreatestGift 12-04-2011 09:09 PM

Code:

^([a-zA-Z0-9]{6})$
--------------- Added [DATE]1323036650[/DATE] at [TIME]1323036650[/TIME] ---------------

this might work, or get you going in the right direction. not the best at regex

--------------- Added [DATE]1323036760[/DATE] at [TIME]1323036760[/TIME] ---------------

would be easier if we knew what this was going to be used for.

you can test your expressions with
http://regexlib.com and the Regex tester link

nerbert 12-04-2011 11:31 PM

<a href="https://vborg.vbsupport.ru/showthread.php?p=2257327&highlight=regular+express ion+tester#post2257327" target="_blank">https://vborg.vbsupport.ru/showt...er#post2257327</a>

demo7up 12-04-2011 11:56 PM

didnt work but thanks im trying to use the tester its for a custom field that i only want to allow 6 letters or number any combination just cant surpass 6 characters.

nerbert 12-05-2011 01:21 AM

This seems to work

/\b[a-zA-Z0-9]{6}\b/

demo7up 12-05-2011 01:54 AM

Quote:

Originally Posted by nerbert (Post 2274751)
This seems to work

/\b[a-zA-Z0-9]{6}\b/


i get this error when i add that to the custom field and the text i am entering is "nycjdm" w/o the quotes

Code:

You did not enter the correct format for the License Plate Text field. Please read the field description for the expected format.

nerbert 12-05-2011 02:13 AM

Well, what is the "field description for the expected format"?

demo7up 12-05-2011 02:22 AM

1 Attachment(s)
Here is a screen shot

demo7up 12-05-2011 02:22 AM

nvm i got it working thanks!!! u rock

LifesGreatestGift 12-05-2011 07:02 PM

so what was the issue? what did you do to resolve it? what regex ended up working?


All times are GMT. The time now is 11:09 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.01006 seconds
  • Memory Usage 1,734KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete