12-19-2010
Regular Expression doesn't match dot "." in a string
hello,
I am writting a regular expression that intend to match any tunnel or serial interface but it doesn't mtach any serial sub-interface.
For example, statement should match "Tunnel3" or "Serial0/1" but shouldn't match "Serial0\1.1" (doesn't include dot ".")
I tried the following but it doesn't work:
interface (Tunnel.*|Serial.*[^\.].*)
interface (Tunnel.*|Serial[^\.]+)
Please advice.
10 More Discussions You Might Find Interesting
1. Email Antispam Techniques and Email Filtering
attempt to filter "dsl..pacbell.net
. . .any pointers?
/etc/procmailrc
# attempt at egrep regular expression to match
# adsl-63-199-245-128.dsl.snd g02.pacbell.net
VERBOSE = yes
:0
* ^Received:.*dsl+\.+\.pacbell+\.net
{
LOG="(PacBell DSL) "
:0
/zzPacbellDSL
}
VERBOSE = no... (0 Replies)
Discussion started by: jones
0 Replies
2. Linux
Regular expression to extract "y" from "abc/x.y.z" (2 Replies)
Discussion started by: rag84dec
2 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I'm struggling with a regex that would match a 'b' that follows an 'a' and is at the end of a string of non-white characters. For example:
Line 1: aba abab b abb aab bab baa
I can find the right strings but I'm lacking knowledge of how to "discard" the bits that precede bs.... (2 Replies)
Discussion started by: machinogodzilla
2 Replies
4. Shell Programming and Scripting
I have 2000 files named like "file-fr0000.log", "file-fr1999.log"...
I wanna generate the file names automatically in the following c shell script:
set fr = 0
while ($fr <= 1999)
grep "ENERGY" file-fr$fr.log > data.dat
@ fr = ( $fr + 1 )
end
The above will generate file names... (3 Replies)
Discussion started by: rockytodd
3 Replies
5. Shell Programming and Scripting
I have a file that contains the 2 following lines (from /proc/mounts)
/dev/sdc1 /mnt/backup2 xfs rw,relatime,attr2,noquota 0 0
/dev/sdb1 /mnt/backup xfs rw,relatime,attr2,noquota 0 0
I need to match the string in the second column exactly so that only one result is returned, e.g.
> grep... (2 Replies)
Discussion started by: jelloir
2 Replies
6. Shell Programming and Scripting
logs:
"/home/abc/public_html/index.php"
"/home/abc/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
how to use "cut" or "awk" or "sed" to get the following result:
abc
abc
xyz
xyz
xyz (8 Replies)
Discussion started by: timmywong
8 Replies
7. Shell Programming and Scripting
Hi,
I'm dealing with an issue and losing a lot of hours figuring out how i would solve this.
I have an input file which looks like this:
('BLABLA +200-GRS','Serviço ','TarifaçãoServiço','wap.bla.us.0000000121',2985,0,55,' de conversão em escada','Dia','Domingos')
('BLABLA +200-GRR','Serviço... (6 Replies)
Discussion started by: poliver
6 Replies
8. Shell Programming and Scripting
Hello.
Following recommendations for one of my threads, this is working perfectly :
#!/bin/bash
CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" )
Now I need a grep success for some thing like :
#!/bin/bash
CNT=$( grep -c -e "some text_1... (4 Replies)
Discussion started by: jcdole
4 Replies
9. Shell Programming and Scripting
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
10. Shell Programming and Scripting
I need to find two matches in the output from ps. I am searching with ps -ef |grep mysql for:
my.cnf
/bin/sh /usr/bin/mysqld_safe --defaults-file=/data/mysql/master/agis_core/etc/my.cnf
after this match I want to search back and match the hostname which is x number of lines back, above the... (2 Replies)
Discussion started by: bash_in_my_head
2 Replies