Return-Path: X-Original-To: apmail-jmeter-dev-archive@minotaur.apache.org Delivered-To: apmail-jmeter-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 835DFEFA1 for ; Thu, 22 Nov 2012 20:35:49 +0000 (UTC) Received: (qmail 48908 invoked by uid 500); 22 Nov 2012 20:35:49 -0000 Delivered-To: apmail-jmeter-dev-archive@jmeter.apache.org Received: (qmail 48859 invoked by uid 500); 22 Nov 2012 20:35:49 -0000 Mailing-List: contact dev-help@jmeter.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jmeter.apache.org Delivered-To: mailing list dev@jmeter.apache.org Received: (qmail 48847 invoked by uid 99); 22 Nov 2012 20:35:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Nov 2012 20:35:49 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of philippe.mouawad@gmail.com designates 209.85.223.171 as permitted sender) Received: from [209.85.223.171] (HELO mail-ie0-f171.google.com) (209.85.223.171) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Nov 2012 20:35:44 +0000 Received: by mail-ie0-f171.google.com with SMTP id 17so7173722iea.2 for ; Thu, 22 Nov 2012 12:35:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=oyMRUJUst7GMzicSmjr4+onnlegiz5OCMpiR9Hg3tZI=; b=TrB3IlNOUx1Xjl3r1HoP1+MjMY6rBBYtRTU0KFZVH804Fi8hh+SC6ysslV+lyzlDs2 JM9mIo71n6Nv3pP0QVHh0PQ6uRl0s/JbKKDnaf4TshVheZVerFy/OJbrp7eprSf0fUYe VmYwYNlceRCF/XTu3XCSfc4JEOzWw/Nmo/Ivc0pnPwMJWOcl31ZJALpcXNRxZzqcgx+V lXCqRX50Q6g/OXIPS/CbP7MNOB2zJJVdZTBTtEH8Js00xKsqnICwXF7MwUssu6373ijn pwLZJhSmArejTrdQtmei+jCB8VavK8CxgZaOEIkFixqZ02KjxXzRTn6TfOLSOKIR5QN0 jzVw== MIME-Version: 1.0 Received: by 10.50.11.167 with SMTP id r7mr1683775igb.18.1353616523956; Thu, 22 Nov 2012 12:35:23 -0800 (PST) Received: by 10.64.136.175 with HTTP; Thu, 22 Nov 2012 12:35:23 -0800 (PST) In-Reply-To: References: Date: Thu, 22 Nov 2012 21:35:23 +0100 Message-ID: Subject: Re: [Bug 54189] New: Add a function to quote ORO regexp meta characters From: Philippe Mouawad To: dev@jmeter.apache.org Content-Type: multipart/alternative; boundary=e89a8f64671f12933204cf1b68b1 X-Virus-Checked: Checked by ClamAV on apache.org --e89a8f64671f12933204cf1b68b1 Content-Type: text/plain; charset=ISO-8859-1 On Thu, Nov 22, 2012 at 2:09 PM, sebb wrote: > On 22 November 2012 12:48, Philippe Mouawad > wrote: > > Hello Sebb, > > I already implemented it, I can remove it if you dislike it. > > > > I implemented it to answer initial requirement mentionned here: > > > > - https://issues.apache.org/bugzilla/show_bug.cgi?id=54176 > > - > > > http://stackoverflow.com/questions/13472646/how-to-escape-regular-expression-characters-from-variable-in-jmeter > > I'd not realised there was a quoteMeta() method already. > > However, using the function is very awkward; it would be better to > implement \Q \E. > Why is it awkward ? > AFAICT would not be difficult; just need to watch out for \\Q versus > \Q. Same for \E. > And then ensure that the method is invoked whenever strings are passed to > ORO. > > But there will still be other features of Java regexes (e.g. > look-behind) that people will try to use and wonder why JMeter does > not work. > > > Regarding ORO , I agree with you but what about compatibility ? > > I'm not sure what compatibility issues you are referring to. > > Are regexp syntax the same ? > > it would be an option of regexp components ? > > Not sure what you mean here. > If syntax is different, then we would need that no ? but if they are exactly the same then no need for it > > > Regards > > Philippe > > > > > > On Thu, Nov 22, 2012 at 1:41 PM, sebb wrote: > > > >> On 22 November 2012 12:07, wrote: > >> > https://issues.apache.org/bugzilla/show_bug.cgi?id=54189 > >> > > >> > Bug ID: 54189 > >> > Summary: Add a function to quote ORO regexp meta characters > >> > Product: JMeter > >> > Version: 2.8 > >> > Hardware: All > >> > OS: All > >> > Status: NEW > >> > Severity: enhancement > >> > Priority: P2 > >> > Component: Main > >> > Assignee: issues@jmeter.apache.org > >> > Reporter: p.mouawad@ubik-ingenierie.com > >> > Classification: Unclassified > >> > > >> > This function would do the equivalent of \Q \E for ORO Regexp as it > does > >> not > >> > exist in it. > >> > >> Quoting strings won't be trivial. > >> Also I'm not sure how one would use it in test plans - seems like it > >> would be very awkward to use. > >> A better solution might be to implement \Q \E processing, e.g. by > >> converting the string if it contains \Q and \E. > >> [This would require the additiional step of first splitting the string > >> into chunks delimited by \Q and \E] > >> > >> However the changes would be a waste of time if we decide to replace > >> ORO with Java regex processing. > >> > >> AIUI ORO was used originally because it was faster than the Java > >> equivalent; however that was a long time ago. > >> It's likely that the Java implementation has been improved since then. > >> There may possibly be some advantages of the ORO implementation, but I > >> can't think of any off-hand. > >> > >> I think we need to look at whether ORO is still needed before trying > >> to fix any of its omissions. > >> > > > > > > > > -- > > Cordialement. > > Philippe Mouawad. > -- Cordialement. Philippe Mouawad. --e89a8f64671f12933204cf1b68b1--