I want to check the following with regular expression
{Today,Format}
Today - will be remains as it is. In the place of Format, we can allow the digits from 0 to 12.
for example: we have to allow
{Today,0}
{Today,1}
{Today,2}
...
{Today,12}
and also have to allow
{Today,}
{Today,Format}
Please help me and also refer me to some site to develop my regular expression skills.
I want to check the following with regular expression
{Today,Format}
Today - will be remains as it is. In the place of Format, we can allow the digits from 0 to 12.
for example: we have to allow
{Today,0}
{Today,1}
{Today,2}
...
{Today,12}
and also have to allow
{Today,}
{Today,Format}
Please help me and also refer me to some site to develop my regular expression skills.
Share Improve this question edited Feb 5, 2010 at 1:43 cletus 625k169 gold badges919 silver badges945 bronze badges asked Dec 23, 2008 at 11:16 praveenjayapalpraveenjayapal 38.5k31 gold badges74 silver badges74 bronze badges 1- Just FYI, 'regex' is a far more mon tag than 'regular-expression' or similar. – cletus Commented Dec 23, 2008 at 12:01
4 Answers
Reset to default 18\{Today,(\d|1[012]|Format)?\}
Meaning:
- Open curly brace;
- 'Today,';
- Optionally one of the following: a digit (0-9), 1 followed by 0, 1 or 2 (10,11,12), 'Format'; and then
- Close curly brace.
As for resources I can remend this site on regular expressions and the book Mastering Regular Expressions.
txt2re. is a brilliant web-based regex generator...
You might also find this list of regular expression software quite useful. Rubular is my favorite.
This is a short cheat sheet to regex.