[Tutor] Failing regex to identify error stack

Flynn, Stephen (Life & Pensions) Steve.Flynn at capita.co.uk
Fri Sep 20 04:29:25 EDT 2019


Oracle error messages are pretty standardised - do you have a pressing need to use RegEx's?

Why not something straightforward such as

If log_line contains "ERROR at line":

Or make use of

log_line.startswith("Fal-")

You're probably going to have to write a regex for each and every Oracle error prefix, like "ORA-" and so forth, so I can't see much benefit in using a RegEx anyway...


S.
-----Original Message-----
From: Tutor <tutor-bounces+steve.flynn=capita.co.uk at python.org> On Behalf Of Asad
Sent: 20 September 2019 09:10
To: tutor at python.org
Subject: [Tutor] Failing regex to identify error stack

Hi All ,

I am writing a script in python to read a logfile and identify the first error stack :

?/test/admin/nothing.sql

PL/SQL procedure successfully completed.
Session altered.
Package created.
Session altered.
Session altered.
Package body created.
No errors.
Session altered.
PL/SQL procedure successfully completed.

ERROR at line 9:
Fal-11144: size of object not allowed


I am trying to use the following regex :

^.*/test/admin/.*(?=ERROR at line .*)(?=Fal-.*)

using lookahead because seems in regex there is no && operator

Please advice .

Thanks,
--
Asad Hasan
+91 9582111698
_______________________________________________
Tutor maillist  -  Tutor at python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


This message has been scanned by Capita systems, but if you believe it to be spam, please send it to spam at forcepoint.com.

Messages sent to spam at forcepoint.com are queued for email analysis by Forcepoint Threat Lab.


This email is security checked and subject to the disclaimer on web-page: http://www.capita.co.uk/email-disclaimer.aspx


More information about the Tutor mailing list