[pcre-dev] [Bug 1600] Issue with Regex

Kezdőlap
Üzenet törlése
Szerző: Prashant Joshi
Dátum:  
Címzett: pcre-dev
Tárgy: [pcre-dev] [Bug 1600] Issue with Regex
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1600




--- Comment #7 from Prashant Joshi <pjoshi@???> 2015-03-20 04:52:44 ---
Hi,

In our application we used APIs of theses libs.
I tried to search PCRE version on the older version but do not get.
In older version we have very few files "pcre.c", "pgrep.c" & "study.c".
We used function "pcre_complie" & "pcre_exec".


In newer version we have a lot files and we used similar functions in our
application.
Applications are same for both versions of PCRE.
No manipulations we have done in regex we directly called these functions.

Regards
Prashant Joshi
Team Lead C/C++ (CA Engagement)
HCL Technologies Ltd.
A-8/9, Sector 60, Noida 201301, U.P. (India)
Mob: +91-9717055938
E-Mail: pjoshi@???
www.hcltech.com
www.hcl.in


-----Original Message-----
From: admin@??? [mailto:admin@bugs.exim.org] On Behalf Of Philip
Hazel
Sent: Thursday, March 19, 2015 9:30 PM
To: Prashant Joshi - ERS, HCL Tech
Subject: [Bug 1600] Issue with Regex

------- You are receiving this mail because: -------
You reported the bug.

http://bugs.exim.org/show_bug.cgi?id=1600


Hi,



--- Comment #6 from Philip Hazel <ph10@???> 2015-03-19 15:59:45
---
On Thu, 19 Mar 2015, Prashant Joshi wrote:

> Regex 1:
> " /Letzter Messwert.*</th><td class="ActualDataTableBody"
> align="center">([^<].*)</td><td class="ActualDataTableBody"
> align="center">([^<].*)</td><td class="ActualDataTableBody"
> align="center">([^<].*)</td></tr><tr><th scope="row"
> class="ActualDataTableRowLabel">Mittelwert/"
>
> Attached text on which we tried to find above regex.


What program are you using to handle that regex? PCRE is just a library,
so it has to be called by another program. That program may well be
pre-processing the regex before passing it to PCRE.

> When I changed this regex to below regex it worked with 8.34:
> Regex 2:
> /Letzter Messwert[\s]+<\/th><td
> class="ActualDataTableBody".*>[-+]?([0-9]*\.[0-9]+|[0-9]+)<\/td><td
> class="ActualDataTableBody".*>[-+]?([0-9]*\.[0-9]+|[0-9]+)<\/td><td
> class="ActualDataTableBody".*>[-+]?([0-9]*\.[0-9]+|[0-9]+)<\/td><\/tr><tr><th
> scope="row" class="ActualDataTableRowLabel">Mittelwert/
>
> Regex 1 is working with PCRE 0.2 but not with 8.34.
> Regex 2 is working with PCRE 8.34.


There never was a PCRE release 0.2, so I do not know what software you
were using. The first release of PCRE was 0.91 (10-Sep-97).

> Please let me know why is above behavior? Also Are there any other regex
> changes which do not work with PCRE 8.34.


It seems to me that whatever program you fed Regex 1 into was somehow
processing it to allow for pairs of "" within the overall quotes, and
was also handling the / delimiters within the pattern. I do not know
what program might do that.

Regex 2 looks like a regex delimited by / that is handled by a program
that needs escaping internal / characters as \/ as you have done. The
pcretest program will do this.

So I ask again: what program are you actually passing your input to?

Philip


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email


::DISCLAIMER::
----------------------------------------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended
for the named recipient(s) only.
E-mail transmission is not guaranteed to be secure or error-free as information
could be intercepted, corrupted,
lost, destroyed, arrive late or incomplete, or may contain viruses in
transmission. The e mail and its contents
(with or without referred errors) shall therefore not attach any liability on
the originator or HCL or its affiliates.
Views or opinions, if any, presented in this email are solely those of the
author and may not necessarily reflect the
views or opinions of HCL or its affiliates. Any form of reproduction,
dissemination, copying, disclosure, modification,
distribution and / or publication of this message without the prior written
consent of authorized representative of
HCL is strictly prohibited. If you have received this email in error please
delete it and notify the sender immediately.
Before opening any email and/or attachments, please check them for viruses and
other defects.

----------------------------------------------------------------------------------------------------------------------------------------------------


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email