Overview
| Artifact ID: | e9d1c66faa8d4a63a652a41de647479a01d43eec |
|---|---|
| Ticket: | 787339ffffffffffffffffffffffffffffffffff
string match failure with meta-characters |
| User & Date: | nobody on 2003-08-12 11:21:42 |
Changes
- assignee changed to: "dkf"
- cmimetype changed to: "text/plain"
- comment changed to:
string match fails if pattern contains the meta-chars *, \ , [, ] or ?, even using backslash in pattern (as man page states). * and ? meta chars are always interpreted as meta, even if backslashed. The remaining ones are never matched. Reproducible bug: string match "\*" "sjdjshddsdsj" gives 1 set a "jashjdhasjd\\" string match "\\" $a gives 0 Expected result: for the first example: false, because trailing backslash should force the * to be interpreted as literal. for the second example: true, because $a contains a backslash How to circumvent: use regexp with ascii encoding (braces are mandatory): regexp {\x02a} "hsajdhds*sadd" gives 1 while regexp {\x02a} "hsajdhdssadd" gives 0, and so on. \ = 05c * = 02a ? = 03f [ = 50b ] = 05d [email protected] - foundin changed to: "obsolete: 8.4.4"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "18. Commands M-Z"
- title changed to: "string match failure with meta-characters"
- type changed to: "Bug"