Unix Expressions


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Unix Expressions
# 1  
Old 03-04-2009
Unix Expressions

Hi to all,
this is my first time in the forum...and I know some basic's about UNIX...
I want to write an expression to validate a field.
field is varchar2, length is 5, can be from '00001' to '99999'.
no loops or if condition, just check the value if between these two numbers it is OK if it is '00000' expression will fail.
How can I do this, and could you explain some details about how it is done.

Thanks

Habeeb
# 2  
Old 03-04-2009
Quote:
field is varchar2, length is 5, can be from '00001' to '99999'.
Sounds very oracle to me...
I though I knew a little unix, reading this post makes me doubt...
What do you call expression?
Is it a simple test condition you are looking for?
# 3  
Old 03-04-2009
yes, its a simple test
will this work
egrep '[1-9]'

or if I can provide a ragne like this
egrep '['00001'-'99999']
will this work?

Last edited by DukeNuke2; 03-04-2009 at 02:46 PM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

ISO UNIX Tutoring in Regular Expressions

Hello all- New to this forum, and relatively new to using grep at the Terminal command line to work with regular expressions. I've got a background in mathematics and some programming experience, so it's not been too difficult to learn the basics of searching through word lists for particular types... (6 Replies)
Discussion started by: dtalvacchio
6 Replies

2. Shell Programming and Scripting

awk expressions

when I use Input command | awk '$2~/::/' 300 12:3:0 FC 15 normal 559104 525312 6:6:1* 7:6:1 600 301 12:3:1 FC 15 normal 559104 525312 6:6:1 7:6:1* 600 302 12:3:2 FC 15 normal 559104 524288 6:6:1* 7:6:1 600 303 12:3:3 FC 15... (12 Replies)
Discussion started by: vishalgoyal
12 Replies

3. Shell Programming and Scripting

Help with regular expressions

I have a file that I'm trying to find all the cases of phone number extensions and deleting them. So input file looks like: abc x93825 def 13234 x52673 hello output looks like: abc def 13234 hello Basically delete lines that have 5 numbers following "x". I tried: x\(4) but it... (7 Replies)
Discussion started by: pxalpine
7 Replies

4. Shell Programming and Scripting

Regular Expressions

#!/usr/bin/perl $word = "one last challenge"; if ( $word =~ /^(\w+).*\s(\w+)$/ ) { print "$1"; print "\n"; print "$2"; } The output shows that "$1" is with result one and "$2" is with result challenge. I am confused about how this pattern match expression works step by step. I... (8 Replies)
Discussion started by: DavidHe
8 Replies

5. UNIX for Dummies Questions & Answers

Regular expressions

In regular expressions with grep(or egrep), ^ works if we want something in starting of line..but what if we write ^^^ or ^ for pattern matching??..Hope u all r familiar with regular expressions for pattern matching.. (1 Reply)
Discussion started by: aadi_uni
1 Replies

6. Shell Programming and Scripting

Need help with Regular Expressions

Hi, In ksh, I am trying to compare folder names having -141- in it's name. e.g.: 4567-141-8098 should match this expression '*-141-*' but, -141-2354 should fail when compared with '*-141-*' simlarly, abc should fail when compared with '*-141-*' I tried multiple things but nevertheless,... (5 Replies)
Discussion started by: jidsh
5 Replies

7. UNIX for Dummies Questions & Answers

regular expressions

how to find for a file whose name has all characters in uppercase after 'project'? I tried this: find . -name 'project**.pdf' ./projectABC.pdf ./projectABC123.pdf I want only ./projectABC.pdf What is the regular expression that correponds to "all characters are capital"? thanks (8 Replies)
Discussion started by: melanie_pfefer
8 Replies

8. Shell Programming and Scripting

Tagged regular expressions(TRE) in unix

Hi gurus, Can any of you suggest any good link for going through tagged regular expressions for unix.I am finding it quite critical and need some help from all gurus to know this better. Any good link containing detailed examples with descriptions would do i guess. thanks in advance. (0 Replies)
Discussion started by: navojit dutta
0 Replies

9. Shell Programming and Scripting

Regular Expressions

How can i create a regular expression which can detect a new line charcter followed by a special character say * and replace these both by a string of zero length? Eg: Input File san.txt hello hi ... (6 Replies)
Discussion started by: sandeep_hi
6 Replies

10. Programming

regular expressions in c++

How do I use the regular expressions in c++? (2 Replies)
Discussion started by: szzz
2 Replies
Login or Register to Ask a Question