[glug-t] Re: gdb and regexp question ! (RegExp)
- From: Rams <cl10120@xxxxxxxx>
- To: glug_t@xxxxxxxxxxxxx
- Date: Fri, 16 Jul 2004 23:30:57 +0530
Few more Addons for RegExp/Suggestions,
Vijay writes:
> > a.For any date in mm/dd/yyyy format
>
> [[:digit:]]{2}/[[:digit:]]{2}/[[:digit:]]{4}
If you are more concerned about the constraint 0<mm<13 & things like this
go for awk/perl.
> > b.All lines that contain matching bracket (e.g. This line should match)
>
> (.*)
Again go for awk/perl if nested parenthesis and match checking is required.
> > f.All lines in a given shell script that are NOT commented
>
> ^[^#]
For general cases where Comments may be indented, use
grep -e -v "^[[:space:]]*#" script-file
> > g.Email address where allowed letters are A-Z, a-z and 0-9 (e.g.
> > some1@xxxxxxxxxxx)
>
> [[:alnum:]]*@[[:alnum:].]*
A small modification in the above RegExp -> [[:alnum:]]*@[[:alnum:]]\.*
for the above regexp would match someone@.nowhere, its corrected in this.
- Rams
-------------------------------------------------
This mail sent through IMP(http://www.nitt.edu)
---------------------------------------------------------------
To unsubscribe send a mail to glug_t-request@xxxxxxxxxxxxx with
'unsubscribe' as subject.
Website: http://glugt.linuxisle.com
- References:
- [glug-t] Re: gdb and regexp question !
- From: Vijay Kumar Bagavath Singh
Other related posts:
- » [glug-t] Re: gdb and regexp question ! (RegExp)
- » [glug-t] Re: gdb and regexp question ! (RegExp)
- [glug-t] Re: gdb and regexp question !
- From: Vijay Kumar Bagavath Singh