- 推荐使用 Regexp101 来学习正则表达式 - Ref
- 在浏览知乎时,我更倾向于关注问题[question]以及回答,而非文章[zhuanlan]内容;搜索时,会习惯性的用 正则表达式 site:zhihu.com/question
- Regexp#flag d 记录匹配索引
- Regexp#escape()
- Regexp#\p{…}
^(?=.*[0-9])(?=.*[a-zA-Z]).{8,30}$
- Regexp#
.
不匹配\n \r \u2028 \u2029
; 应用于不同场景,不同环境对这些字符做相应处理[渲染]- \n, Line Feed, LF, 换行符 \u000A
- \r, Carriage Return, CR, 回车符 \u000D
- \u2028, Line Separator, 强制换行 (视觉)
- \u2029, Paragraph Separator, 段落分隔符 (段落)
- Regexp#
\s
匹配[\r\n\t\f\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff\u0020]
- \n \r \u2028 \u2029
- \t, Tab \u0009
- \f, 换页/分页符 \u000C
- \v, 垂直制表符 \u000B
- \u0020 space 空格
- \u00a0, non-breaking space NBSP
- \u1680 Ogham 文字系统中的空白
- \u2000-\u200a 用于精细排版,表示不同宽度的空白
- \u202f 法语、俄语等语言中,用于数字与单位之间的空格; 是 non-breaking space
- \u205f 数学排版中,用于控制符号之间的间距,来自 TeX、LaTeX 排版系统的 spacing 定义;可以断行
- \u3000 全角,CJK Symbols; 用于中文、日文、韩文中排版/视觉上对称; 过去在打印文本或电子书中较为常见,现在也偶尔用于美观排版
- \ufeff BOM [byte-order mark], 字节顺序标记 - 高端/低端字节顺序
- CSS#插入 break 属性
- overflow-wrap[word-wrap]
- overflow-wrap will only create a break if an entire word cannot be placed on its own line without overflowing
- normal
- anywhere 1) 任意可插入断行位置尽可能插入 2) 再强制断行防止溢出[overflow]
- break-word 强制断行防止溢出[overflow] - unbreakable words allowed to be broken at arbitrary points
- word-break
- normal, 英文:单词不会中断,只会在空格或连字符 - 等合法断点换行; CJK 文字可以在任意字符之间断行 (特殊标点符号除外)
- 禁止出现在行首的标点 -
、
,。
,,
,!
,?
,)
,》
,】
- 禁止出现在行末的标点 -
“
,‘
,(
,《
,【
- 禁止出现在行首的标点 -
- break-all, Word breaks should be inserted between any two characters; (excluding Chinese/Japanese/Korean text)
- keep-all, Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal
- break-word 效果和
overflow-wrap: anywhere; work-break: normal;
相同 - auto-phrase
- normal, 英文:单词不会中断,只会在空格或连字符 - 等合法断点换行; CJK 文字可以在任意字符之间断行 (特殊标点符号除外)
- hyphens - ­
- none
- manual
- auto
- hyphenate-character 定义连字符是什么
- hyphenate-limit-chars 定义使用连字符策略
- line-break 处理多语言混排时换行策略
- auto, 会倾向于避免在中英文中间断行,或避免在标点符号后断开 [chatgpt]
- normal
- loose
- strict, 严格遵守行首行尾禁则
- anywhere
- white-space-collapse
- collapse
- preserve
- preserve-breaks
- preserve-spaces
- break-spaces
- text-wrap-mode
- wrap
- nowrap
- text-wrap-style
- auto
- balance
- pretty
- stable
- text-wrap shorthand, text-wrap-mode, text-wrap-style
- wrap
- nowrap
- balance
- pretty
- stable
- white-space shorthand, text-wrap-mode
- normal
- pre
- pre-wrap
- pre-line
- wrap
- collapse
- preserve nowrap
- overflow-wrap[word-wrap]
- CSS#空白样式
- unicode#几个字符
- unicode#U+FE0F 变异字符,VS16[Variation Selector-16]; **This codepoint may change the appearance of the preceding character. If that is a symbol, dingbat or emoji, U+FE0F forces it to be rendered as a colorful image as compared to a monochrome text variant. **
- Emoji If Emoji=No, then Emoji_Presentation=No, Emoji_Modifier=No, and Emoji_Modifier_Base=No
- Emoji_Presentation 本身是 emoji, 图形符号而非文本,且有一部分支持继续使用 Modifier 改样式
- Emoji_Modifier_Base 本身是 emoji,可以使用 modifier 改样式
- Emoji_Modifier 本身不是 emoji, 用来修饰,比如颜色; \UFE0F
- Emoji_Component 本身不是 emoji,在 emoji 组合中会被用作“组件”,使用上面提到的 \U200D 连接
- Extended_Pictographic 扩展,All
- Ref
- solution:subgrid/solution:需要存在文本[text]
- CSS#shape clockwise, counterclockwise
- 避世离俗 - 梁博 - 精气神
- 老板要我开发一个简单的工作流引擎 - XState 实现
- CSS#animation-composition - Ref
- Dynamic Toggle with [type=radio] + :has()
- CSS#@supports
- 匮乏感 - 别人拥有了,就仿佛自己失去了
-
他们明明知道我们知道他们在撒谎,但他们依然在撒谎
- 学会正确的表达自己的需求,学会控制情绪
- Understanding various syntaxes to annotate a function’s type in TypeScript
type IIdentity = { // call signature (v: number): number, // other properties, if any whoAmI: "I am identity man" } // or interface IIdentity { // call signature (v: number): number, // other properties, if any whoAmI: "I am identity man" }
- 图片占位算法 - ThumbHash
transition-[run/start/end/cancel]
- TransitionEvent- queueMicrotask
2025 第 20 周
发布: