Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Regular expression.

Posted on 2007-04-03
2
349 Views
Last Modified: 2012-06-21
[0-9]{6}

YYYYMM
200400
The expression above excepts  200400
We must not let it accept it.
0
Comment
Question by:mathieu_cupryk
  • 2
2 Comments
 
LVL 35

Expert Comment

by:mrichmon
ID: 18845302
([12][0-9]{3})(0[1-9]|1[0-2])

which allows the year to start with 1 or 2 followed by 3 digits, then the month syould be 01 upto 09 or 10 through 12
0
 
LVL 35

Accepted Solution

by:
mrichmon earned 500 total points
ID: 18845310
Also if you are using a language or parser that returns parenthesized substring matches, you will get the year in the first substring match and the month in the second.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to create an MVC5, Razor Widget 2 26
Modal Popup Extender control 1 38
Footer for each row on Gridview 2 33
TimeZone, day light savings, Sql server, asp.net 6 37
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question