Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #11  
Old 08-01-2008, 01:05 PM
silentace silentace is offline
 
Join Date: Oct 2005
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
Code:
/^([0-9][A-Z][0-9][X13579][0-9])(DEP|Civ){0,1}$/
Closer but still no cigar. BTW thank you guys for all your help. That string allows me to put in the first type like 2E2X1 and stops lower case letters but it won't allow any combo of dep or civ no matter what case. Again thanks for the help and if anyone has more ideas I welcome anything right now =)
Reply With Quote
  #12  
Old 08-02-2008, 04:41 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My code (post #10) does work - I have tested it myself. Please post your implementation of it.
Reply With Quote
  #13  
Old 08-02-2008, 05:26 AM
silentace silentace is offline
 
Join Date: Oct 2005
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
My code (post #10) does work - I have tested it myself. Please post your implementation of it.
I am not sure what posting my implementation means? do you want the site i run it on? or do you want me to copy and paste exactly what i put in?

^([0-9][A-Z][0-9][X13579][0-9])(DEP|Civ){0,1}$

With Regex Coach it doesn't work with dep/DEP/civ/Civ or anything. I also tried on my site and it'not working either, same issue as with regex. I even tried with the beginning and trailing "/" but that didn't work either.
Reply With Quote
  #14  
Old 08-02-2008, 05:43 AM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Isn't there supposed to be a pipe in there?

Code:
^([0-9][A-Z][0-9][X13579][0-9])|(DEP|Civ){0,1}$
Reply With Quote
  #15  
Old 08-02-2008, 07:04 AM
silentace silentace is offline
 
Join Date: Oct 2005
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Digital Jedi View Post
Isn't there supposed to be a pipe in there?

Code:
^([0-9][A-Z][0-9][X13579][0-9])|(DEP|Civ){0,1}$
With the last few ideas i have tried throwing it in there and it doesn't help
Reply With Quote
  #16  
Old 08-02-2008, 11:07 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by silentace View Post
I am not sure what posting my implementation means? do you want the site i run it on? or do you want me to copy and paste exactly what i put in?

^([0-9][A-Z][0-9][X13579][0-9])(DEP|Civ){0,1}$

With Regex Coach it doesn't work with dep/DEP/civ/Civ or anything. I also tried on my site and it'not working either, same issue as with regex. I even tried with the beginning and trailing "/" but that didn't work either.
Implementation = how you are using it (ie. post the code that is using the regex).
Quote:
Originally Posted by Digital Jedi View Post
Isn't there supposed to be a pipe in there?

Code:
^([0-9][A-Z][0-9][X13579][0-9])|(DEP|Civ){0,1}$
No, a pipe will not work - furthermore, my condition at the end makes it optional "{min,max}".
Reply With Quote
  #17  
Old 08-02-2008, 04:11 PM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Reason I asked is because I was testing it in the Regulator and I couldn't get a match until I added the pipe.
Reply With Quote
  #18  
Old 08-02-2008, 04:49 PM
MoT3rror MoT3rror is offline
 
Join Date: Mar 2007
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

http://www.combatarenas.com/test.php

Then here is the php code.
PHP Code:
<?php
echo 'Checking /^([0-9][A-Z][0-9][X13579][0-9])|(DEP|Civ){0,1}$/<br />';

$values = array('2E2X1''3C051''5B174''DEP''Civ');

foreach(
$values AS $value)
{
    if(
preg_match('/^([0-9][A-Z][0-9][X13579][0-9])|(DEP|Civ){0,1}$/'$value))
    {
        echo 
$value ' succeed<br />';
    }
    else
    {
        echo 
$value ' failed<br />';
    }
}

echo 
'<br /><br />Checking /^([0-9][A-Z][0-9][X13579][0-9])(DEP|Civ){0,1}$/<br />';


foreach(
$values AS $value)
{
    if(
preg_match('/^([0-9][A-Z][0-9][X13579][0-9])(DEP|Civ){0,1}$/'$value))
    {
        echo 
$value ' succeed<br />';
    }
    else
    {
        echo 
$value ' failed<br />';
    }
}
?>
So there is aleast one that is working.
Reply With Quote
  #19  
Old 08-02-2008, 07:57 PM
silentace silentace is offline
 
Join Date: Oct 2005
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I guess either the software that tests the code or vbulletin/regex doesn't interpret the equation the right now. in the software it shows

^([0-9][A-Z][0-9][X13579][0-9])|(DEP|Civ){0,1}$

as working perfectly for what i want. DEP is a match Dep is not. Civ is a match and CIV is not. But that exact same code on vbulletin not only matches DEP but dep and depp... and so on. Its like vbulletin doesn't even use the equation that i am putting in.
Reply With Quote
  #20  
Old 08-03-2008, 04:26 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Whoops. I thought you wanted to allow "DEP" or "Civ" tacked onto the end of the string. Sorry, my bad.

This one should work.
Code:
/^(([0-9][A-Z][0-9][X13579][0-9])|(DEP|Civ))$/
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:27 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06740 seconds
  • Memory Usage 2,265KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (5)bbcode_code
  • (1)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete