|
|
| Problems? Is your data what you think it is? | |
| PerlMonks |
Commify function regex in Perl vs sedby harangzsolt33 (Deacon) |
| on Sep 20, 2025 at 22:24 UTC ( [id://11166289]=perlquestion: print w/replies, xml ) | Need Help?? |
|
harangzsolt33 has asked for the wisdom of the Perl Monks concerning the following question:
I don't know where to post this question as it's somewhat off-topic. But seriously, I am trying to figure this out and AI wasn't able to help me. And I have tried to fool with this for hours to no use. So, I'm about to give up.
I saw a regex here on PerlMonks awhile back that took a string and inserts commas into numbers. It's pretty amazing how that works, and I am just now beginning to grasp why and how it works. But now I would like to port it to bash. Now, of course, bash doesn't have regex search and replace but sed does. So, when I plugged this into sed, it complains and says "sed: -e expression #1, char 39: Invalid preceding regular expression" (I'm using sed GNU v4.9 and bash 5.2.15 x64) WHAT IS WRONG???
And now the BASH script:
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||||||||