Sponsored Content
Top Forums Shell Programming and Scripting Understanding regex behaviour when using quantifiers Post 302750267 by DGPickett on Monday 31st of December 2012 09:56:37 AM
Old 12-31-2012
This is shorter: Regular expression - Wikipedia, the free encyclopedia

QED went to MULTICS, probably before UNIX, and became qedx, which is very close to ed and ex. Later, Waterloo ported it to FRED.

grep -E is essentially egrep is ERE.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting perl regex to sed regex

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

find: "weird" regex behaviour

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

Understanding a regex

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

help understanding regex with grep & sed

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

Need Quick help on Understanding sed Regex

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

Perl, RegEx - Help me to understand the regex!

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

Need help understanding this Regex.

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

Sendmail K command regex: adding exclusion/negative lookahead to regex -a@MATCH

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

Help with understanding this regex in a Perl script parsing a 'complex' string

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

Regarding a GREAT site for understanding and Visualizing regex patterns.

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
WIKIPEDIA2TEXT(1)					      General Commands Manual						 WIKIPEDIA2TEXT(1)

NAME
wikipedia2text -- displays Wikipedia entries on the command line SYNOPSIS
wikipedia2text [-BCnNoOpPsSuU] [-b prog] [ {-c | -i | -I } patt] [-l lang] [-W base-url] Query wikipedia2text -o [-b prog] [-l lang] Query wikipedia2text [-h] wikipedia2text -v wikipedia2text -r DESCRIPTION
This manual page documents briefly the wikipedia2text command. wikipedia2text fetches and renders Wikipedia articles using a text-mode web-browser (currently recognises elinks, links2, links, lynx and w3m) and display the text of the article on STDOUT respectively in a pager. OPTIONS
The program recognizes the following command line options: -b prog Use program prog as browser. -B Do not use browser configured via configuration file or environment. -c patt, -I patt Colorize case-sensitive pattern patt in output. -C, -N Colorize output. -h Show help and a summary of options. -i patt Colorize case-insensitive pattern patt in output. -l lang use Wikipedia in language lang. See the Wikipedia Languages entry elsewhere in this document. -n Do not colorize output. -o Open the Wikipedia page in the browser. -O Do not open the Wikipedia page in the browser. -p Use a pager (set by default). -P Don't use a pager. -r Display a random Wikipedia article. -s Display only the summary of the Wikipedia article. -S Display the full content of the Wikipedia article and not only the summary. -u Just print the URL of the Wikipedia page and exit. -U Display the full content of the Wikipedia article and not only print the URL of the page. -v Show version number. -W base-url use base-url as base URL for wikipedia (e.g. use a different wiki), querying this URL will happen by appending the search term. ENVIRONMENT
The following environment variables are recognized: ABROWSER Browser to use as default instead of to found or configured web browser. IGNCASE Default value for case-sensitivity of colorizing the output. Can be set to "true" or "false". LOCAL Default value for language in which Wikipedia should be used. See the Wikipedia Languages entry elsewhere in this document. OUTPUTURL Determines, if wikipedia2text should display only the URL of the Wikipedia article by default. Can be set to "true" or "false". PAGER Default value for pager to use. Can also be set to "true", in which case, wikipedia2text tries to figure out the appropriate pager, or "false", which means not to use a pager at all. SHORT Determines, if wikipedia2text should display only the summary of the Wikipedia article by default. Can be set to "true" or "false". USEBROWSER Determines, if wikipedia2text should open the Wikipedia page via openurl in the globally set default browser, i.e. Firefox or Konqueror, by default. Can be set to "true" or "false". FILES
$HOME/.wikipedia2textrc Will be sourced from wikipedia2text on startup. Should contain variable assignments. The same variables as for the environment are recognised. WIKIPEDIA LANGUAGES
wikipedia2text currently supports the following Wikipedia languages: af Cape Dutch (Afrikaans) als Alemannic ca Catalan cs Czech da Danish de German en English eo Esperanto es Spanish fi Finnish fr French hu Hungarian ia Interlingua is Islandic it Italian la Latin lb Luxembourgian nds Low German nl Dutch nn, no Norwegian (Nynorsk and Bokmal) pl Polish pt Portuguese rm Rhaeto-Romanic ro Romanian simple Simple English sk Slovak sl Slovenian sv Swedish tr Turkish SEE ALSO
elinks(1), links(1), links2(1), lynx(1), w3m(1) AUTHOR
wikipedia2text was written by Christian Brabandt <cb@256bit.org>. Patches also from Axel Beckert <abe@deuxchevaux.org>. This manual page was written by Axel Beckert <abe@deuxchevaux.org> for the Debian system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License (GPL), Version 2 any later ver- sion published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. HISTORY
wikipedia2text was first released by Christian Brabandt on in his blog (link to URL http://blog.256bit.org/archives/126-Wikipedia-in-der- Shell.html) with as script named wiki. Some users may find it useful to create an alias with that name for speeding up the typing of a wikipedia2text command if no other command of that name is present. OTHER INFO
The current version of wikipedia2text should be available at on Christian Brabandt's website (link to URL http://www.256bit.org/~chris- bra/wiki) . WIKIPEDIA2TEXT(1)
All times are GMT -4. The time now is 06:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy