Jump to content

stringregexp not working


dwaynek
 Share

Recommended Posts

you need to say 3 letters for sure, and then maybe one other.  I think that range is the only issue, you could do it like so instead:

$a="1232ssni123.mp4"
$b="1232ssn123.wmv"
$c="1232ss123.wmv" ; negative test not enough letters
$d="1232ssni123.wma" ; negative test extension

msgbox(0,"",StringRegExp($a,"\d{4}[A-Za-z]{3}[A-Za-z]*\d{3}\.(avi|mp4|wmv|mkv)"))
msgbox(0,"",StringRegExp($b,"\d{4}[A-Za-z]{3}[A-Za-z]*\d{3}\.(avi|mp4|wmv|mkv)"))
msgbox(0,"",StringRegExp($c,"\d{4}[A-Za-z]{3}[A-Za-z]*\d{3}\.(avi|mp4|wmv|mkv)"))
msgbox(0,"",StringRegExp($d,"\d{4}[A-Za-z]{3}[A-Za-z]*\d{3}\.(avi|mp4|wmv|mkv)"))

 

Edited by iamtheky

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

well no, according to the help file you could have also just exchanged your dash for a comma

$a="1232ssni123.mp4"
$b="1232ssn123.mp4"

msgbox(0,"",StringRegExp($a,"\d{4}[A-Za-z]{3,4}\d{3}\.(avi|mp4|wmv|mkv)"))
msgbox(0,"",StringRegExp($b,"\d{4}[A-Za-z]{3,4}\d{3}\.(avi|mp4|wmv|mkv)"))

 

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...