PHP 正则表达式从字符串降价
我有这个字符串:“从[http://wordpress.org/extend/plugins/wordpress-mobile-admin/](http://wordpress.org/extend/plugins/wordpress-mobile-admin)下载它/)
";
我正在尝试将这个 markdown 转换为实际的 HTML,我尝试像这样获取匹配:
preg_match_all('/[(.*?)]((.*?))/', $data[$toProcess], $links);
debug($links);
但这.. 不起作用。
任何人都可以指出我将这个 Markdown 转换为 HTML 的正确方向吗?
附:我不想导入整个 Markdown 库。
I have this string: "Download it from [http://wordpress.org/extend/plugins/wordpress-mobile-admin/](http://wordpress.org/extend/plugins/wordpress-mobile-admin/)
";
And i'm trying to convert this markdown to actual HTML, i tried getting the matches like so:
preg_match_all('/[(.*?)]((.*?))/', $data[$toProcess], $links);
debug($links);
Yet this..did not work.
Can anyone point me in the right direction to convert this markdown into HTML.
ps. i'd rather not import the whole markdown library.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要转义
[
,]
,(
和)
因为它们都是正则表达式元字符:You need to escape the
[
,]
,(
and)
as they are all regex meta-characters: