- XF 兼容性
- 2.3.x
- 摘要
- Custom Field Regex Capture for user, thread, resource, and media fields. Easily extract video IDs from YouTube URLs with custom display options. Download now!
在自定义字段中使用正则表达式捕获值,并可访问到用于值和包装显示的HTML选项;适用于用户、主题、资源和媒体字段。例如,可以从包含在URL中的正则表达式字段中提取视频ID。
获取Custom Field Regex Capture的免费下载?因为这个资源自2025年6月27日起立即可用。
自定义字段正则表达式:
自定义字段包装显示HTML:
获取Custom Field Regex Capture的免费下载?因为这个资源自2025年6月27日起立即可用。
自定义字段正则表达式:
代码:
(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube(?:-nocookie)?\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))(?<videoId>[\w-]{11})(?![\w-])
自定义字段包装显示HTML:
代码:
<iframe width="560" height="315" src="https://www.youtube.com/embed/{$videoId}" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>