12-31-2012
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. Shell Programming and Scripting
I have these two files in current dir:
oos.txt
oos_(copy).txt
I execute this find command:find . -regex './oos*.txt'And this outputs only the first file (oos.txt)! :confused:
Only if I add another asterisk to the find find . -regex './oos*.*txt' do I also get the second file... (7 Replies)
Discussion started by: courteous
7 Replies
3. Shell Programming and Scripting
Hi,
Please help me to understand the bold segments in the below regex.
Both are of same type whose meaning I am looking for.
find . \( -iregex './\{6,10\}./src' \) -type d -maxdepth 2
Output:
./20111210.0/src
In continuation to above:
sed -e 's|./\(*.\{1,3\}\).*|\1|g'
Output: ... (4 Replies)
Discussion started by: vibhor_agarwali
4 Replies
4. 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
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
www::wikipedia::entry
WWW::Wikipedia::Entry(3pm) User Contributed Perl Documentation WWW::Wikipedia::Entry(3pm)
NAME
WWW::Wikipedia::Entry - A class for representing a Wikipedia Entry
SYNOPSIS
my $wiki = WWW::Wikipedia->new();
my $entry = $wiki->search( 'Perl' );
print $entry->text();
my $entry_es = $entry->language( 'es' );
print $entry_es->text();
DESCRIPTION
WWW::Wikipedia::Entry objects are usually created using the search() method on a WWW::Wikipedia object to search for a term. Once you've
got an entry object you can then extract pieces of information from the entry using the following methods.
METHODS
new()
You probably won't use this one, it's the constructor that is called behind the scenes with the correct arguments by
WWW::Wikipedia::search().
text()
The brief text for the entry. This will provide the first paragraph of text; basically everything up to the first heading. Ordinarily this
will be what you want to use. When there doesn't appear to be summary text you will be returned the fulltext instead.
If text() returns nothing then you probably are looking at a disambiguation entry, and should use related() to lookup more specific
entries.
text_basic()
The same as "text()", but not run through Text::Autoformat.
fulltext()
Returns the full text for the entry, which can be extensive.
fulltext_basic()
The same as "fulltext()", but not run through Text::Autoformat.
title()
Returns a title of the entry.
related()
Returns a list of terms in the wikipedia that are mentioned in the entry text.
categories()
Returns a list of categories which the entry is part of. So Perl is part of the Programming languages category.
headings()
Returns a list of headings used in the entry.
raw()
Returns the raw wikitext for the entry.
language()
With no parameters, it will return the current language of the entry. By specifying a two-letter language code, it will return the same
entry in that language, if available.
languages()
Returns an array of two letter language codes denoting the languages in which this entry is available.
AUTHORS
Ed Summers <ehs@pobox.com>
Brian Cassidy <bricas@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2003-2011 by Ed Summers
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2011-02-16 WWW::Wikipedia::Entry(3pm)