Sponsored Content
Full Discussion: Problem with Date validation
Top Forums Shell Programming and Scripting Problem with Date validation Post 302100010 by sumesh.abraham on Friday 15th of December 2006 10:23:19 AM
Old 12-15-2006
It worked!!Thanks Vino.

Cheers,
Sumesh
sumesh.abraham
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Date Validation again

I want a sample Date validation script using if loops. The script should first compare "year".If the year is lesser than the current year,It should go for "month" checking. I have the script that splits the date into year,month and date.I want only the checking part. My if loop checking is not... (4 Replies)
Discussion started by: dave_nithis
4 Replies

2. Shell Programming and Scripting

Date Validation:

Hi I have below file with 3 rd column as date ....i want to make 3 column to mm/dd/yyyy . in the below file 2 row date is like 1/23/1994 so i want to append '0' to month i,e. 01/23/1994 and in the 3 row date is like 6/4/1994 ---so i want this to 06/04/1994 Source:... (1 Reply)
Discussion started by: satyam_sat
1 Replies

3. Shell Programming and Scripting

Date Validation

the user have to input the date format in mmddmmhhyyyy (month,date,minutes,hour,year) i want a shell script to check whether the user has properly input in the above said manner. kindly advice (2 Replies)
Discussion started by: vkca
2 Replies

4. Shell Programming and Scripting

Date Validation in unix

I have a script which is take date as parameter sh abc.sh <2010-02-01> #!/sh/bin my_date=$1 #Here i want to two diffrent dates ## 3 Days before ##date14query=$mydate - 4 (it will be 2010-01-28) ##date24query=$mydate +4 (it will be 2010-01-05) #Please Help (3 Replies)
Discussion started by: pritish.sas
3 Replies

5. Shell Programming and Scripting

Date validation

Hi, I have a script which runs on specific sunday. If that script runs on the sunday i want to execute another script on following wednesday. I have a log for that server. My wednesday scripts needs to check the sunday run log timestamp and if it matches it should run. Please help. Thanks,... (1 Reply)
Discussion started by: Krrishv
1 Replies

6. Shell Programming and Scripting

Date validation

File contains below data,how to validate the date using awk command or any command. date formate is fixed as "YYYYMMDD" test1|20120405 test2|20121405 output should be: test1|20120405 Thanks (2 Replies)
Discussion started by: bmk
2 Replies

7. Programming

Date validation in mysql

Hi All, We need to create the custom function to pass the parameter is date.if it is valid return 1 else 0 return should be 1 select is_date('2012-09-17'); return should be 0 select is_date('2012-79-17'); Thanks (2 Replies)
Discussion started by: bmk
2 Replies

8. Shell Programming and Scripting

Validation of date from file name

I'm writing a shell script for cleanup of older files from various sub-directories inside a main directory The structure of directories is as below: Logs daily online archive weekly online archive... (1 Reply)
Discussion started by: asyed
1 Replies

9. UNIX for Dummies Questions & Answers

Date Validation not working

Hi Experts, I have a date validation script in that i will validate the date for a given format and search in the logs for that date. The script logic is very simple like below. Validate_Date() { is_valid=1 while do date_format=$(date "+$1") echo -e "Please enter the $2 date like... (6 Replies)
Discussion started by: senthil.ak
6 Replies

10. What is on Your Mind?

Date validation

Hi folks, I new to shell script . I want to know how to validate a String as valid date example: 20150712 ---> valid date 20160524-->valid 201605T12-->invalid date 12341234--->invalid date we need to valid string( yyyymmdd) to date in SunOS 5.10 please give some idea to validate... (9 Replies)
Discussion started by: srinadhreddy27
9 Replies
QRegExpValidator(3qt)													     QRegExpValidator(3qt)

NAME
QRegExpValidator - Used to check a string against a SYNOPSIS
#include <qvalidator.h> Inherits QValidator. Public Members QRegExpValidator ( QObject * parent, const char * name = 0 ) QRegExpValidator ( const QRegExp & rx, QObject * parent, const char * name = 0 ) ~QRegExpValidator () virtual QValidator::State validate ( QString & input, int & pos ) const void setRegExp ( const QRegExp & rx ) const QRegExp & regExp () const DESCRIPTION
The QRegExpValidator class is used to check a string against a regular expression. QRegExpValidator contains a regular expression, "regexp", used to determine whether an input string is Acceptable, Intermediate or Invalid. The regexp is treated as if it begins with the start of string assertion, ^, and ends with the end of string assertion $ so the match is against the entire input string, or from the given position if a start position greater than zero is given. For a brief introduction to Qt's regexp engine see QRegExp. Example of use: // regexp: optional '-' followed by between 1 and 3 digits QRegExp rx( "-?\d{1,3}" ); QRegExpValidator validator( rx, 0 ); QLineEdit *edit = new QLineEdit( split ); edit->setValidator( &validator ); Below we present some examples of validators. In practice they would normally be associated with a widget as in the example above. // integers 1 to 9999 QRegExp rx( "[1-9]\d{0,3}" ); // the validator treats the regexp as "^[1-9]\d{0,3}$" QRegExpValidator v( rx, 0 ); QString s; s = "0"; v.validate( s, 0 ); // returns Invalid s = "12345"; v.validate( s, 0 ); // returns Invalid s = "1"; v.validate( s, 0 ); // returns Acceptable rx.setPattern( "\S+" ); // one or more non-whitespace characters v.setRegExp( rx ); s = "myfile.txt"; v.validate( s, 0 ); // Returns Acceptable s = "my file.txt"; v.validate( s, 0 ); // Returns Invalid // A, B or C followed by exactly five digits followed by W, X, Y or Z rx.setPattern( "[A-C]\d{5}[W-Z]" ); v.setRegExp( rx ); s = "a12345Z"; v.validate( s, 0 ); // Returns Invalid s = "A12345Z"; v.validate( s, 0 ); // Returns Acceptable s = "B12"; v.validate( s, 0 ); // Returns Intermediate // match most 'readme' files rx.setPattern( "read\S?me(.(txt|asc|1st))?" ); rx.setCaseSensitive( FALSE ); v.setRegExp( rx ); s = "readme"; v.validate( s, 0 ); // Returns Acceptable s = "README.1ST"; v.validate( s, 0 ); // Returns Acceptable s = "read me.txt"; v.validate( s, 0 ); // Returns Invalid s = "readm"; v.validate( s, 0 ); // Returns Intermediate See also QRegExp, QIntValidator, QDoubleValidator, and Miscellaneous Classes. MEMBER FUNCTION DOCUMENTATION
QRegExpValidator::QRegExpValidator ( QObject * parent, const char * name = 0 ) Constructs a validator that accepts any string (including an empty one) as valid. The object's parent is parent and its name is name. QRegExpValidator::QRegExpValidator ( const QRegExp & rx, QObject * parent, const char * name = 0 ) Constructs a validator which accepts all strings that match the regular expression rx. The object's parent is parent and its name is name. The match is made against the entire string, e.g. if the regexp is [A-Fa-f0-9]+ it will be treated as ^[A-Fa-f0-9]+$. QRegExpValidator::~QRegExpValidator () Destroys the validator, freeing any resources allocated. const QRegExp &; QRegExpValidator::regExp () const Returns the regular expression used for validation. See also setRegExp(). void QRegExpValidator::setRegExp ( const QRegExp & rx ) Sets the regular expression used for validation to rx. See also regExp(). QValidator::State QRegExpValidator::validate ( QString & input, int & pos ) const [virtual] Returns Acceptable if input is matched by the regular expression for this validator, Intermediate if it has matched partially (i.e. could be a valid match if additional valid characters are added), and Invalid if input is not matched. The start position is the beginning of the string unless pos is given and is > 0 in which case the regexp is matched from pos until the end of the string. For example, if the regular expression is &#92;w&#92;d&#92;d (that is, word-character, digit, digit) then "A57" is Acceptable," E5" is Intermediate and "+9" is Invalid. See also QRegExp::match() and QRegExp::search(). Reimplemented from QValidator. SEE ALSO
http://doc.trolltech.com/qregexpvalidator.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. AUTHOR
Generated automatically from the source code. BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qregexpvalidator.3qt) and the Qt version (3.1.1). Trolltech AS 9 December 2002 QRegExpValidator(3qt)
All times are GMT -4. The time now is 04:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy