K
K
kbc5902014-09-19 02:56:30
PHP
kbc590, 2014-09-19 02:56:30

Search in the text for a link to a file for subsequent replacement with html-code?

There is a markdown editor, I want to replace links to .mp3 files with a player.
The problem is that the link can be relative or start with http://
By design, the link should be separated by hyphens.
A space or several spaces can be followed by a file name for substitution in the player.


Regular paragraph. Then we do a line break and insert a link.
1. mp3
Or you can with the name.
1.mp3 Best song
Ili...
ya.ru/1.mp3 Title

The task is to pull out all such links to mp3 files that are on separate lines, may or may not have a name, so that you can replace it with an html player.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Ezhgurov, 2014-09-19
@kbc590

For example, like this:
Restriction: mp3 file name must not contain spaces

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question