03-02-2012
In general this would mean \{m,n\}a minimum of 'm' numbers and maximum of 'n' numbers in length. Its actually the range. So
[0-9]\{6,10\} - this matches numbers of atleast 6 and atmost 10 in length, hence it matched: 20111210. If in case you have a dir which is say 20112 - this would not get displayed as it has totally/length 5 numbers, whereas our condition says to find with minimum of 6 numbers and a max of 10. Similarly in Sed
.[0-9]\{1,3\} after a dot find for number which is of minimum 1 and a max of 3 in length
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am having trouble parsing rpm filenames in a shell script.. I found a snippet of perl code that will perform the task but I really don't have time to rewrite the entire script in perl. I cannot for the life of me convert this code into something sed-friendly:
if ($rpm =~ /(*)-(*)-(*)\.(.*)/)... (1 Reply)
Discussion started by: suntzu
1 Replies
2. UNIX for Dummies Questions & Answers
I have a file of protein sequences with headers (my source file). Based on a list of IDs (which are included in some of the headers), I'd like to print out only the specified sequences, with only the ID as header.
In other words, I'd like to search source.txt for the terms in IDs.txt, and print... (3 Replies)
Discussion started by: pathunkathunk
3 Replies
3. Shell Programming and Scripting
I have the following line of code that works wonders. I just don't completely understand it as I am just starting to learn regex. Can you help me understand exactly what is happening here?
find . -type f | grep -v '^\.$' | sed 's!\.\/!!' (4 Replies)
Discussion started by: trogdortheburni
4 Replies
4. Shell Programming and Scripting
# echo "Teest string" | sed 's/e*/=>replaced=</'
=>replaced<=Teest string
So, in the above code , sed replaces at the start. does that mean sed using the pattern e* settles to zero occurence ? Why sed was not able to replace Teest string.
# echo "Teest string" | sed 's/e*//g'
Tst string
... (6 Replies)
Discussion started by: chidori
6 Replies
5. Shell Programming and Scripting
Hi Guys,
Could you please kindly explain what exactly the below SED command will do ?
I am quite confused and i assumed that,
sed 's/*$/ /'
1. It will remove tab and extra spaces .. with single space.
The issue is if it is removing tab then it should be Î right ..
please assist.... (3 Replies)
Discussion started by: Nandy
3 Replies
6. Shell Programming and Scripting
I am not a big expert in regex and have just little understanding of that language.
Could you help me to understand the regular Perl expression:
^(?!if\b|else\b|while\b|)(?:+?\s+){1,6}(+\s*)\(*\) *?(?:^*;?+){0,10}\{
------
This is regex to select functions from a C/C++ source and defined in... (2 Replies)
Discussion started by: alex_5161
2 Replies
7. Shell Programming and Scripting
Hi everyone,
This regex looks simple and yet it doesn't make sense how it's manipulating the output.
ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0c:49:c2:35:6v
inet addr:192.16.1.1 Bcast:192.168.226.255 Mask:255.255.255.0
inet6 addr:... (2 Replies)
Discussion started by: xcod3r
2 Replies
8. Shell Programming and Scripting
I'm trying to get some exclusions into our sendmail regular expression for the K command. The following configuration & regex works:
LOCAL_CONFIG
#
Kcheckaddress regex -a@MATCH
+<@+?\.++?\.(us|info|to|br|bid|cn|ru)
LOCAL_RULESETS
SLocal_check_mail
# check address against various regex... (0 Replies)
Discussion started by: RobbieTheK
0 Replies
9. UNIX for Beginners Questions & Answers
Hi,
I need some guidance with understanding this Perl script below. I am not the author of the script and the author has not leave any documentation. I supposed it is meant to be 'easy' if you're a Perl or regex guru. I am having problem understanding what regex to use :confused: The script does... (3 Replies)
Discussion started by: newbie_01
3 Replies
10. Programming
Hello All,
While googling on regex I came across a site named Regulex Regulex:JavaScript Regular Expression Visualizer
I have written a simple regex ^(a|b|c)(*)@(.*) and could see its visualization; one could export it too, following is the screen shot.
... (3 Replies)
Discussion started by: RavinderSingh13
3 Replies
LEARN ABOUT DEBIAN
numbound
NUMBOUND(1) User Contributed Perl Documentation NUMBOUND(1)
NAME
numbound - Find boundary numbers in files or STDIN.
SYNOPSIS
numbound [-dhlV] <FILE>
| numbound [-dhlV] (Input on STDIN from pipeline.)
numbound [-dhlV] (Input on STDIN. Use Ctrl-D to stop.)
DESCRIPTION
numbound will find boundary numbers (minimum and maximum) in files or STDIN. By default it will find the upper bound in the set of numbers
(the maximum number) in the files or on STDIN. You can use the -l option for finding the lower bound (minumum number).
OPTIONS
-l -- Return the lower bound number in the set (the minimum number)
-h Help: You're looking at it.
-V Increase verbosity.
-d Debug mode. For developers
BUGS
numbound currently will only gather the first number on each line instead of all the numbers on the lines.
SEE ALSO
numaverage(1), numinterval(1), numnormalize(1), numgrep(1), numprocess(1), numsum(1), numrandom(1), numrange(1), numround(1)
COPYRIGHT
numbound is part of the num-utils package, which is copyrighted by Suso Banderas and released under the GPL license. Please read the
COPYING and LICENSE files that came with the num-utils package
Developers can read the GOALS file and contact me about providing
submitions or help for the project.
MORE INFO
More info on numbound can be found at:
http://suso.suso.org/programs/num-utils/
perl v5.10.1 2009-10-31 NUMBOUND(1)