>> the /a "flag" can also be used to limit the character class to ASCII
>> space characters:
>>
>> - $content =~ s/^\s*//;
>> - $content =~ s/\s*$//;
>> + $content =~ s/^\s*//a;
>> + $content =~ s/\s*$//a;
>
> This looks good, thanks. However, it is probably necessary to filter
> out the ideographic space (U+3000), too.
>
> Masamichi-san, what do you think? Here is a link to the complete
> conversation:
>
> https://lists.gnu.org/archive/html/bug-texinfo/2022-01/msg00005.html
>
> Other CJK users, please also comment!
I think it is not necessary to filter out U+3000.
In the widely used Japanese TeX system (pTeX, upTeX, and LuaTeX-ja),
U+3000 is output as-is and is not filtered out.
Processing the following `.tex` containing U+3000 with lualatex,
you get a PDF that looks right-aligned.
```
\documentclass{ltjsarticle}
\begin{document}
\begin{tabular}{ll}
^^^^3000^^^^3000^^^^3042 & ^^^^3000^^^^3000^^^^3042 \\
^^^^3000^^^^3042^^^^3042 & ^^^^3000^^^^3042^^^^3042 \\
^^^^3042^^^^3042^^^^3042 & ^^^^3042^^^^3042^^^^3042 \\
\end{tabular}
\end{document}
```