Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-02-2004, 01:01 PM   #1
LQ Newbie
Registered: Sep 2004
Location: USA
Distribution: Fedora Core 3
Posts: 29

Rep: Reputation: 15
Unhappy [KSH-Regular Expressions] How can I specify Repition pattern in a variable?


I have a script which takes a list of numbers and classifies them into sever categories. The category that I am having a hard time in is the one where it has to a positive number (non decimal) and has the number 7 two times in it.

I tried this:

if [ [ $thenumber = @(+([1-9])7{2,}@(0|2|4|6|8)) ] ]

but then it does not work.

the mistake I know is in: 7{2,}.

Is there a different syntax or way of checking such thing.

I am using Bash shell or Korn shell in Fedora.

It also has to be done via regular expressions.

Thank You in Advanced,


Last edited by Aziz; 11-02-2004 at 01:03 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Regular Expressions markjuggles Programming 2 05-05-2005 11:39 AM
Regular Expressions overbored Linux - Software 3 06-24-2004 02:34 PM
help with REGULAR EXPRESSIONS ner Linux - General 23 10-31-2003 11:09 PM
Regular expressions aromes Linux - General 1 10-15-2003 12:29 PM
regular expressions? alaios Linux - General 2 06-11-2003 03:51 PM

All times are GMT -5. The time now is 07:04 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration