On 12/1/17 12:40 PM, d...@computer42.org wrote:

> Bash Version: 4.4
> Patch Level: 12
> Release Status: release
> 
> Description:
>   I'm sanitising urls from advertisement crap. As described below I'm getting 
> a wrong resolution of parenthesised expression defined with non-greedy 
> operator '?'.
> 
>   The test url is: 
> http://toolbox.contentspread.net/container/medimops/track/xxxxxxxxxx.dyn?csRdu=https://www.medimops.de/?anid=M9999999999&cl=details&wdm=M9999999999&utm_source=CRM&utm_medium=email&utm_campaign=OS
> 
>   The regular expression is: 
> https?:\/\/toolbox.contentspread.net\/(.*?)=(.+?)&.*

The Bash =~ operator uses Posix extended regexps (EREs) as defined in
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_04.
There's no concept of a `non-greedy' operator
in the Posix ERE definition.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to