in reply to Re^2: split versus =~
in thread split versus =~
If nothing else works I'll try using a different delimiter coming back from the database and then converting it back just after this step.
I think I would recommend doing that anyway, and doing it first. Something like a colon would be a good choice.
This has the advantage that you can easily (I assume) test it with positive numbers to ensure it doesn't break the old use cases, and no adjustment should be needed to handle negative numbers.
The fact that you need to "convert it back just after this step" implies that some other code will also need to extract the numbers again. That code also needs to be examined to see if it will cope with negative numbers, and my initial guess would be that it will not. I don't have enough information to guess if that code is later in the script that is under your responsibility, or in the code it hands off to.
Unless there are compelling reasons not to, I would recommend changing to a different delimiter for the later parts as well.
|
|---|