Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I hate to post regex questions, but I'm second-guessing myself every time I think I make progress.
The problem: I have a CSV file that Text::CSV is handling very nicely. Unfortunately, it will balk on data like this: "crosby","stills","nash","and sometimes "young"" The input can include any number of characters, and unfortunately, I don't have control over the input to tell people "hey, don't use anything but letters or numbers!" Believe you me, I'd love to put some constraints on their input, but it's a proprietary tool, and, well, I could lecture until I was blue in the face and some snot-nosed kid would immediately enter every non-alphanumeric character he could find. I had tried this, but it's not right:
because it will match the "," that I'm trying to delimit with. My next thought was something like this:
but that would only work if a comma were a class of character... And probably not even then ;) I guess in pseudo-code, I'm after something like this:
Can anyone who has been through this kind of nightmare help me? Thanks, cidaris In reply to CSV and regex mixups by cidaris
|
|