Sponsored Content
Top Forums Shell Programming and Scripting Help: Regular Expression for Negate Matching String Post 302327713 by DrivesMeCrazy on Monday 22nd of June 2009 11:39:50 AM
Old 06-22-2009
Help: Regular Expression for Negate Matching String

Hi guys,

as per subject I am having problem with regular expressions.

Example, if i got a string "javax.servlet.http.HttpServlet.service" that may occurred anywhere within a text file.

How can I used the negate pattern matching of regular expression?

I tried the below pattern but it throws a syntax error.
# egrep '^*(?!javax.servlet.http.HttpServlet.service)*$' test.txt

Appreciate if anyone can help.

Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Regular expression matching a new line

I have written a script to test some isdn links in my network and I am trying to format the output to be more readable. Each line of the output has a different number of digits as follows... Sitename , spid1 12345678901234 1234567890 1234567 , spid2 1234567890 1234567890 1234567 Sitename , ... (1 Reply)
Discussion started by: drheams
1 Replies

2. Shell Programming and Scripting

validate a string against a regular expression

Hi there i have a script which will create unix user accounts. Id like to validate the entered string so that it is specifically 8 characters or less and consists of only ! not Is there a way to validate a string against a regular expression.. i.e size=`printf "$var | wc -m` ... (1 Reply)
Discussion started by: hcclnoodles
1 Replies

3. Programming

Regular Expression matching in PERL

I am trying to read a file and capture particular lines into different strings: LENGTH: Some Content here TEXT: Some Content Here COMMENT: Some Content Here I want to be able to get (LENGTH: .... ) into one array and so on... I'm trying to use PERL in slurp mode but for some reason... (8 Replies)
Discussion started by: Legend986
8 Replies

4. Shell Programming and Scripting

Regular expression matching in BASH (equivalent of =~ in Perl)

In Perl I can write a condition that evaluates a match expression like this: if ($foo =~ /^bar/) { do blah blah blah } How do I write this in shell? What I need to know is what operator do I use? The '=~' doesn't seem to fit. I've tried different operators, I browsed the man page for... (3 Replies)
Discussion started by: indiana_tas
3 Replies

5. Shell Programming and Scripting

Regular expression matching

Hi, I have a variable in my script that gets its value from a procstack output. It could be a number of any length, or it could just be a '1' with 0 or more white spaces around it. I would like to detect when this variable is just a 1 and not a 1234, for example. This is as far as I got: ... (3 Replies)
Discussion started by: tmf33uk
3 Replies

6. Shell Programming and Scripting

Matching single quote in a regular expression

I trying to match the begining of the following line in a perl script with a regular expression. $ENV{'ORACLE_HOME'} I tried this regluar expession: /\$ENV\{\'ORACLE_HOME\'\}/ Instead of match, I got a blank prompt > It seems to be a problem with the single quote. If I take it... (11 Replies)
Discussion started by: JC9672
11 Replies

7. Programming

Perl: How to read from a file, do regular expression and then replace the found regular expression

Hi all, How am I read a file, find the match regular expression and overwrite to the same files. open DESTINATION_FILE, "<tmptravl.dat" or die "tmptravl.dat"; open NEW_DESTINATION_FILE, ">new_tmptravl.dat" or die "new_tmptravl.dat"; while (<DESTINATION_FILE>) { # print... (1 Reply)
Discussion started by: jessy83
1 Replies

8. UNIX for Dummies Questions & Answers

delete lines matching a regular expression

I have a very large file (over 700 million lines) that has some lines that I need to delete. An example of 5 lines of the file: HS4_80:8:2303:19153:193032 153 k80:138891 HS4_80:8:2105:5544:43174 89 k88:81949 165 k88:81949 323 0 * = 323 0 ... (6 Replies)
Discussion started by: pathunkathunk
6 Replies

9. Shell Programming and Scripting

regular expression matching whole words

Hi Consider the file this is a good line when running grep '\b(good|great|excellent)\b' file5 I expect it to match the line but it doesn't... what am i doing wrong?? (ultimately this regex will be in a awk script- just using grep to test it) Thanks, Storms (5 Replies)
Discussion started by: Storms
5 Replies

10. Shell Programming and Scripting

String regular expression

Hi, temp="/usr=25,/usr/lib=12" How to get only dir names with out values. I tried like below but no use. tmp=${temp##*,} echo $tmp o/p: /usr/lib=12 expected o/p: /usr /usr/lib ---> in array (13 Replies)
Discussion started by: munna_dude
13 Replies
SOLRCLIENT(3)								 1							     SOLRCLIENT(3)

The SolrClient class

INTRODUCTION
Used to send requests to a Solr server. Currently, cloning and serialization of SolrClient instances is not supported. CLASS SYNOPSIS
SolrClient final SolrClient Constants o const integer$SolrClient::SEARCH_SERVLET_TYPE1 o const integer$SolrClient::UPDATE_SERVLET_TYPE2 o const integer$SolrClient::THREADS_SERVLET_TYPE4 o const integer$SolrClient::PING_SERVLET_TYPE8 o const integer$SolrClient::TERMS_SERVLET_TYPE16 o const integer$SolrClient::SYSTEM_SERVLET_TYPE32 o const string$SolrClient::DEFAULT_SEARCH_SERVLETselect o const string$SolrClient::DEFAULT_UPDATE_SERVLETupdate o const string$SolrClient::DEFAULT_THREADS_SERVLETadmin/threads o const string$SolrClient::DEFAULT_PING_SERVLETadmin/ping o const string$SolrClient::DEFAULT_TERMS_SERVLETterms o const string$SolrClient::DEFAULT_SYSTEM_SERVLETsystem Methods o public SolrUpdateResponse SolrClient::addDocument (SolrInputDocument $doc, [bool $overwrite = true], [int $commitWithin]) o public void SolrClient::addDocuments (array $docs, [bool $overwrite = true], [int $commitWithin]) o public SolrUpdateResponse SolrClient::commit ([bool $softCommit = false], [bool $waitSearcher = true], [bool $expungeDeletes = false]) o public SolrClient::__construct (array $clientOptions) o public SolrUpdateResponse SolrClient::deleteById (string $id) o public SolrUpdateResponse SolrClient::deleteByIds (array $ids) o public SolrUpdateResponse SolrClient::deleteByQueries (array $queries) o public SolrUpdateResponse SolrClient::deleteByQuery (string $query) o public void SolrClient::__destruct (void ) o public string SolrClient::getDebug (void ) o public array SolrClient::getOptions (void ) o public SolrUpdateResponse SolrClient::optimize ([int $maxSegments = 1], [bool $softCommit = true], [bool $waitSearcher = true]) o public SolrPingResponse SolrClient::ping (void ) o public SolrQueryResponse SolrClient::query (SolrParams $query) o public SolrUpdateResponse SolrClient::request (string $raw_request) o public SolrUpdateResponse SolrClient::rollback (void ) o public void SolrClient::setResponseWriter (string $responseWriter) o public bool SolrClient::setServlet (int $type, string $value) o public void SolrClient::system (void ) o public void SolrClient::threads (void ) PREDEFINED CONSTANTS
o SolrClient::SEARCH_SERVLET_TYPE -Used when updating the search servlet. o SolrClient::UPDATE_SERVLET_TYPE -Used when updating the update servlet. o SolrClient::THREADS_SERVLET_TYPE -Used when updating the threads servlet. o SolrClient::PING_SERVLET_TYPE -Used when updating the ping servlet. o SolrClient::TERMS_SERVLET_TYPE -Used when updating the terms servlet. o SolrClient::SYSTEM_SERVLET_TYPE -Used when retrieving system information from the system servlet. o SolrClient::DEFAULT_SEARCH_SERVLET -This is the intial value for the search servlet. o SolrClient::DEFAULT_UPDATE_SERVLET -This is the intial value for the update servlet. o SolrClient::DEFAULT_THREADS_SERVLET -This is the intial value for the threads servlet. o SolrClient::DEFAULT_PING_SERVLET -This is the intial value for the ping servlet. o SolrClient::DEFAULT_TERMS_SERVLET -This is the intial value for the terms servlet used for the TermsComponent o SolrClient::DEFAULT_SYSTEM_SERVLET -This is the intial value for the system servlet used to obtain Solr Server information PHP Documentation Group SOLRCLIENT(3)
All times are GMT -4. The time now is 03:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy