js正则匹配十六进制颜色
时间: 2023-08-25 07:16:02 浏览: 203
is-hexcolor:检查给定值是否是有效的十六进制颜色,使用 `hex-color-regex` - 匹配十六进制颜色值的最佳正则表达式
根据你提供的信息和引用,你可以使用以下的正则表达式来匹配十六进制颜色:
```javascript
let reg = /^#([A-Fa-f0-9]{6}|<em>1</em><em>2</em><em>3</em>
#### 引用[.reference_title]
- *1* [正则匹配十六进制数字](https://blog.csdn.net/weixin_43706224/article/details/129282779)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}} ] [.reference_item]
- *2* [JS——使用正则表达式验证十六进制颜色代码](https://blog.csdn.net/Kiruthika/article/details/120464828)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}} ] [.reference_item]
- *3* [Java通过正则表达式判断字符串格式(邮箱、十六进制等等)](https://blog.csdn.net/cshoney/article/details/90113166)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}} ] [.reference_item]
[ .reference_list ]
阅读全文