Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 1
    Does sed count 馑 as one character or 3? That is, does echo 馑 | sed s/...// print anything? Commented Apr 17, 2015 at 11:22
  • @immibis Since sed has the g modifier it replaces all occurence also when they follow each other. Also sed should count it as one character, see: echo -ne "馑" | wc -m gives 1. If you count the bytes (wc -c) it would return 3. Did I understand your question correctly? Commented Apr 17, 2015 at 11:28
  • I meant: does . mean "one character" or "one byte"? Commented Apr 17, 2015 at 11:30
  • @immibis I matches one character hence echo 馑 | sed s/...// gives me (nothing is replaced) Commented Apr 17, 2015 at 11:33
  • 4
    @chaos: It works under en_US.UTF-8, but doesn't under C. Commented Apr 17, 2015 at 12:28