python - 如何在python中拆分字符串但将分组符号中的任何内容保留为一个
问题描述
我想取一个字符串:
x = 'The following is a string: \'Here is a nice python string\'
并拆分它,但保持内部字符串完整,以便返回:
['The', 'following', 'is', 'a', 'string:', '\'Here is a nice python string \'']
{}
对于or[]
或,这应该是相同的()
,但是, not <>
。
解决方案
推荐阅读
- graphql - 盖茨比内容丰富的 graphql 图像
- c++ - 标头 ncurses.h 和 curses.h 之间的区别
- augmented-reality - Google Model Viewer AR-如何在没有海报或对象预览的情况下拥有“在 AR 中查看”按钮
- compiler-errors - 如何从 arrayList 中的不同对象调用方法?
- node.js - 错误:无法加载默认凭据
- java - 重复发送 HTTP 请求,即使应用程序在 Android 上处于后台也是如此
- html - 我可以在引导程序上编辑多个类吗?
- graphql - SubSelectionRequired 类型的验证错误:字段的类型为空需要子选择
- javascript - 时刻 - 从星期几计算日期
- java - 使用 JAAS 进行用户验证的最佳场所