Can you salvage my negative lookbehind example for commifying numbers?

后端 未结 3 724
旧时难觅i
旧时难觅i 2021-02-04 04:44

In the \"Advanced Regular Expresssion\" chapter in Mastering Perl, I have a broken example for which I can\'t figure out a nice fix. The example is perhaps trying to be too clev

3条回答
  •  清歌不尽
    2021-02-04 05:11

    If you have to post on Stack Overflow asking if somebody can figure out how to do this with negative lookbehind, then it's obviously not a good example of negative lookbehind. You'd be better off thinking up a new example rather than trying to salvage this one.

    In that spirit, how about an automatic spelling corrector?

    s/(?

    (Obviously, that's not a hard and fast rule in English, but I think it's a more realistic application of negative lookbehind.)

提交回复
热议问题