Expression with a minium length must contan numbers

Tips on writing regular expressions for searching the post list

Moderators: Quade, dexter

Expression with a minium length must contan numbers

Postby Valmont » Sun Apr 10, 2016 5:06 pm

Slowly learning regex by simply doing it.
Code: Select all
[a-zA-Z0-9]{10,}

The code above will search any pattern containing characters or numbers where the combination of therefore, or either numbers or characters have 10 or more literals. That's close to what I want. I need a similar formula but this time
(1) at least one number MUST be contained within the expression to be searched for. Example: 288TVeTU4uQzGBbN_SR1oWPRhQ_7v
Wrong though: qZporGeklnEfoieimnaLhHJtl <-- contains no number(s)
(2) The total amount characters in the entire expression where the range is [a-zA-Z0-9] must have a minimum amount (say 10).
So [COOLCAT].<readtxt>.288TVeTU4uQzGBbN_SR1oWPRhQ_7v.HOMEY.720p.rar qualifies as it has a substring meeting this requirement.

Cheers.
Valmont
Active Participant
Active Participant
 
Posts: 63
Joined: Wed Aug 09, 2006 2:51 pm

Registered Newsbin User since: 06/14/09

Re: Expression with a minium length must contan numbers

Postby Quade » Mon Apr 11, 2016 9:47 am

I'm unclear if you're asking a question or if this is more tutorial in nature.

I tend to use ranges {X,Y} for many of my RE's.
User avatar
Quade
Eternal n00b
Eternal n00b
 
Posts: 44999
Joined: Sat May 19, 2001 12:41 am
Location: Virginia, US

Registered Newsbin User since: 10/24/97

Re: Expression with a minium length must contan numbers

Postby Valmont » Mon Apr 11, 2016 9:55 am

Quade wrote:I'm unclear if you're asking a question or if this is more tutorial in nature.

I tend to use ranges {X,Y} for many of my RE's.

LOL it was a question. But I was illogical so never mind. I got really far myself though I still don't know how to test for a string length!
So let's change my requirements: (1) how to test a string for it's length? How to test the returned substring (which matches the RE) for it's length?
Valmont
Active Participant
Active Participant
 
Posts: 63
Joined: Wed Aug 09, 2006 2:51 pm

Registered Newsbin User since: 06/14/09


Return to Regular Expressions

Who is online

Users browsing this forum: No registered users and 18 guests