473,387 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Regex question

I am trying to write a regular expression that will match all the exceptions
generated in my application log file. I have done it as such:

\bjava\.\w+\.\w+Exception:

However, there are two exceptions that I know will occur and I don't care to
catch them. So I need to modify the above regular expression to ignore the
two exceptions that will get generated.

I don't know how to do that. Your help will be much appreciated.

Thanks,
Z


Jul 17 '05 #1
3 1479
OneSolution wrote:
I am trying to write a regular expression that will match all the exceptions
generated in my application log file. I have done it as such:

\bjava\.\w+\.\w+Exception:

However, there are two exceptions that I know will occur and I don't care to
catch them. So I need to modify the above regular expression to ignore the
two exceptions that will get generated.

I don't know how to do that. Your help will be much appreciated.

Thanks,
Z


You're gonna get jumped on for crossposting, but here's a duplicate of
my post to you in c.l.java.*:

You could use negated lookbehind:

\bjava\.\w+\.\w+(?<!(Type1|Type2))Exception

I *think* that's the right lookbehind syntax...

--
Thanks,
Elliott C. Bäck
---------------------------------
www.elliottback.com/blog/
www.spreadIE.com
Jul 17 '05 #2
On Tue, 12 Oct 2004 21:42:20 GMT, Elliott Back hath writ:
...
I don't know how to do that. Your help will be much appreciated.

...
You're gonna get jumped on for crossposting, ....


I don't see _cross_ posting. So, I guess it was _multi_ posting --
which is more egregious.
Jul 17 '05 #3
"OneSolution" wrote:
I am trying to write a regular expression that will match all the
exceptions
generated in my application log file. I have done it as such:

\bjava\.\w+\.\w+Exception:

However, there are two exceptions that I know will occur and I
don’t care to
catch them. So I need to modify the above regular expression to
ignore the
two exceptions that will get generated.

I don’t know how to do that. Your help will be much
appreciated.

Thanks,
Z


I have a lot of problems with exception handling in regex. Perhpas I
don’t know how to do it...

So I do a pre-process, which changes the exception to something else.
Then I run my regular regex,
and then change the exceptions back to their original condition.
Tedious, but it works.

--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/PHP-Regex-ftopict159819.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=539440
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: engwar1 | last post by:
Not sure where to ask this. Please suggest another newsgroup if this isn't the best place for this question. I'm new to both vb.net and regex. I need a regular expression that will validate what...
4
by: aevans1108 | last post by:
expanding this message to microsoft.public.dotnet.xml Greetings Please direct me to the right group if this is an inappropriate place to post this question. Thanks. I want to format a...
2
by: Tim Conner | last post by:
Hi, Thanks to Peter, Chris and Steven who answered my previous answer about regex to split a string. Actually, it was as easy as create a regex with the pattern "/*-+()," and most of my string...
6
by: Du Dang | last post by:
Text: ===================== <script1> ***stuff A </script1> ***more stuff <script2> ***stuff B
17
by: clintonG | last post by:
I'm using an .aspx tool I found at but as nice as the interface is I think I need to consider using others. Some can generate C# I understand. Your preferences please... <%= Clinton Gallagher ...
5
by: Chris | last post by:
How Do I use the following auto-generated code from The Regulator? '------------------------------------------------------------------------------ ' <autogenerated> ' This code was generated...
6
by: Martin Evans | last post by:
Sorry, yet another REGEX question. I've been struggling with trying to get a regular expression to do the following example in Python: Search and replace all instances of "sleeping" with "dead"....
7
by: Extremest | last post by:
I am using this regex. static Regex paranthesis = new Regex("(\\d*/\\d*)", RegexOptions.IgnoreCase); it should find everything between parenthesis that have some numbers onyl then a forward...
6
by: Phil Barber | last post by:
I am using Regex to validate a file name. I have everything I need except I would like the dot(.) in the filename only to appear once. My question is it possible to allow one instance of character...
6
by: | last post by:
Hi all, Sorry for the lengthy post but as I learned I should post concise-and-complete code. So the code belows shows that the execution of ValidateAddress consumes a lot of time. In the test...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.