标点符号是标记,例如句号,逗号和括号,用于书面分隔句子及其元素并阐明含义。
由于某种原因,字母'n'被注册为grep的标点符号。 test =“n”grepl(“[:punct:]”,test)返回TRUE有没有其他人有这个问题?
我正在尝试将Python程序写入一行Bash中的文件。我正在尝试这个:$ printf“#\!/ usr / bin / python3 \ nprint('hi \!')\ nwhatever()”> whatever.py但是这给出了:#\!/ usr / bin / python3 .. 。
有人可以用正则表达式帮我一点吗?我目前有这个:re.split(“+”,line.rstrip()),用空格分隔。我怎么能扩展它以涵盖标点符号呢?