in reply to Re^2: Case insensitive string comparison
in thread Case insensitive string comparison
I actually did consider the use of anchors. I thought that narrowing the focus to the field of interest would be "good enough". We don't know where this csv data comes from. I suppose that this could potentially come from some spreadsheet or other program which might add "" marks even where not required (but allowed). In that case, something like /^SMS/ would fail.
I think it is highly likely that this data comes from another program rather than from user input. In cases like that, I often write regex'es that allow more matches than a very rigid interpretation because the computer won't "fumble finger" in an extraneous character. All of these types of decisions come down to the exact application which we just don't know.
Overall I think this is a good thread. Although I do wish that the OP had provided more code to put his problem into a wider context. The Monks demonstrated some new points for the OP to consider along with adequate explanations. I hope that the OP reads all this stuff and decides what is right for his application.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Case insensitive string comparison
by DAN0207 (Acolyte) on Jun 30, 2020 at 12:09 UTC | |
by AnomalousMonk (Archbishop) on Jun 30, 2020 at 17:25 UTC | |
by DAN0207 (Acolyte) on Jul 01, 2020 at 06:16 UTC |