Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Search for words starting and ending with Post 303000410 by bakunin on Tuesday 11th of July 2017 08:54:32 PM
Old 07-11-2017
Quote:
Originally Posted by RudiC
Nice approach. You might want to add a plus sign or a star to allow for multiple words. And, not sure if two or more adjacent minus signs are acceptable?
You are right, the missing asterisk was a typo, which i have corrected now. Thank you for spotting it.

You are right about adjacent hyphens maybe being not allowed, but that is a lack of information from the threads o/p. If he can better specify his needs i can construct better suited regexps. The point, though, was to show how a regexp can be constructed from a specification at all.

all the best
bakunin
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl: reg.expr: combine starting and ending removal in one exprecion

Hello, I am new in perl and in regular exprecion; so I am looking for help (or an experienced advise.) The target is a triming spaces from a string: i.e., remove spases from begining and from end of a string. One of main point of a searched solution is performance: for current task it is... (2 Replies)
Discussion started by: alex_5161
2 Replies

2. Shell Programming and Scripting

How to remove all words starting from a matching word in a line

Hi Guys, I have a file like this: wwwe 1 ioie ewew yyy uuu 88 erehrlk 4 ihoiwhe lkjhassad lkhsad yyy mmm 45 jhash lhasdhs lkhsdkjsn ouiyrshroi oihoihswodnw oiyhewe yyy ggg 77 I want to remove everything after "yyy" and including "yyy" from each line in the file. So I want:... (2 Replies)
Discussion started by: npatwardhan
2 Replies

3. Shell Programming and Scripting

if statement to check files with different ending but same starting name

I am trying to check if files staring with filename but ending with diffent dates e.g. filename.2011-10-25. The code I am using is below if It works find only if one file is present but returns binary operator expected when there are mulptiple files. Please help me correcting it. I... (5 Replies)
Discussion started by: ningy
5 Replies

4. UNIX for Advanced & Expert Users

Pring starting and ending numbers using UNIX

Hi all, I need to do scrip for printing starting and ending numbers along with count in given file.:wall: Input: a.txt 10000030 10000029 10000028 10000027 10000026 10000024 10000023 10000021 10000018 10000018 10000017 10000016 10000015 10000014 (2 Replies)
Discussion started by: jackbell2013
2 Replies

5. Shell Programming and Scripting

Extract words starting with a pattern from a file

Hi Guys.. I have a file and i want to extract all words that starts with a pattern 'ABC_' or 'ADF_' For example, ABC.txt ---- INSERT INTO ABC_DLKFJAL_FJKLD SELECT DISTINCT S,B,C FROM ADF_DKF_KDFJ_IERU8 A, ABC_LKDJFREUE9_FJKDF B WHERE A.FI=B.EI; COMMIT; Output : ABS_DLKFJAL_FJKLD,... (5 Replies)
Discussion started by: Pramod_009
5 Replies

6. Shell Programming and Scripting

Sorting a list of words one per line by their ending

Hello, My OS is Windows and therefore DOS. Hence I have no access to Unix tools. I am trying to sort a file in Urdu by the character by which it ends. Each word is on a separate line. As input, an example in English would help: fruit banana apple pear house I need the sort to be on the... (5 Replies)
Discussion started by: gimley
5 Replies

7. Shell Programming and Scripting

Print words starting at particular positions

I have three words say abc def and ghi. I want to write them in a text file each starting (not ending) at particular positions say 1, 42 and 73. It is guaranteed that they will not overwrite. Length of the three variable may vary. Any help? (5 Replies)
Discussion started by: Soham
5 Replies

8. Shell Programming and Scripting

Text to column starting/ending with special character in each row

Hello, Here is my text data excerpted from the webpage: input My target is to get: What i tried is: sed 's/.*\(connector\)/1/' input > output but all characters coming before the word "connector" are deleted which is not good for me. My question: (9 Replies)
Discussion started by: baris35
9 Replies

9. Shell Programming and Scripting

Count the words starting with 3-

OS : Oracle Linux 6.5 Shell : bash I have a file whose contents look like below. I want to count the number of occurences of strings starting with 3-. How can I do this ? I couldn't wordwrap the below line. Hence it looks long. '3-90892405251', '3-90892911050', '3-90893144163',... (8 Replies)
Discussion started by: John K
8 Replies

10. Shell Programming and Scripting

Search words in any quote position and then change the words

hi, i need to replace all words in any quote position and then need to change the words inside the file thousand of raw. textfile data : "Ninguno","Confirma","JuicioABC" "JuicioCOMP","Recurso","JuicioABC" "JuicioDELL","Nulidad","Nosino" "Solidade","JuicioEUR","Segundo" need... (1 Reply)
Discussion started by: benjietambling
1 Replies
WWW::Search::AltaVista(3pm)				User Contributed Perl Documentation			       WWW::Search::AltaVista(3pm)

NAME
WWW::Search::AltaVista - class for searching www.altavista.com SYNOPSIS
require WWW::Search; $search = new WWW::Search('AltaVista'); DESCRIPTION
This class is an AltaVista specialization of WWW::Search. It handles making and interpreting AltaVista searches http://www.altavista.com. This class exports no public interface; all interaction should be done through WWW::Search objects. OPTIONS
The default is "any of these words" (OR of query terms). aqa=all+of+these+words Add the AND of these words to the query. aqp=this+exact+phrase Add "this exact phrase" to the query. aqo=any+of+these+words Add the OR of these words to the query. This is where the query is placed by default. aqn=none+of+these+words Add NOT these words to the query. aqb=(boolean+AND+expression)+NEAR+entry Add a boolean expression to the query. Operators are AND, OR, AND NOT, and NEAR. In the browser interface, the boolean expression can not be combined with any other query types listed above. You should probably build the boolean expression with parentheses and spaces and urlescape it. aqs=these+words Pages containing "these words" will be ranked highest. kgs=[0,1] To restrict the search to U.S. websites, set kgs=1. The default is world-wide, kgs=0. kls=[0,1] To restrict the search to pages in English and Spanish, set kls=1. The default is no language restrictions, kls=0. filetype=[html,pdf] To restrict the search to HTML pages only, set filetype=html. To restrict the search to PDF pages only, set filetype=pdf. The default is no restriction on page type, filetype=. rc=dmn&swd=net+org+or.jp To restrict the search to pages from certain domains, set rc=dmn and set swd to a list of desired toplevel domains. rc=url&lh=www.sandcrawler.com/SWB To restrict the search to pages from a particular site, set rc=url and set lh to the site name and path. Leave off the http:// from the site. PUBLIC METHODS
gui_query Call this instead of native_query() if you want to get the same results as your average Joe web surfer. PRIVATE METHODS
native_setup_search This private method does the heavy lifting after you call native_query() or gui_query(). parse_tree This private method does the hard work of parsing the results out of the HTML. BUGS
Not all of the above options have been tested. Please report bugs and send feature requests via email to "bug-WWW-Search-AltaVista@rt.cpan.org", or via the web interface at https://rt.cpan.org/NoAuth/Bugs.html?Dist=WWW-Search-AltaVista <https://rt.cpan.org/NoAuth/Bugs.html?Dist=WWW-Search-AltaVista>. SEE ALSO
To make new back-ends, see WWW::Search, or the specialized AltaVista searches described in options. AUTHOR
Written by John Heidemann, "johnh@isi.edu"; maintained by Martin Thurn, "mthurn@cpan.org". LICENSE
This software is released under the same license as Perl itself. COPYRIGHT
Copyright (c) 1996-1998 University of Southern California. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of Southern California, Information Sciences Institute. The name of the University may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. perl v5.12.4 2011-11-02 WWW::Search::AltaVista(3pm)
All times are GMT -4. The time now is 07:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy