I have a <textarea> where the user enters his text. The text can contain special chars which I need to parse and replace with HTML tags for display purposes.
For example:
Bolded text will be entered as: *some text* and parsed to: <strong>some text</strong>.
URL will be entered as: #some text | to/url# and parsed to: <a href="to/url">some text</a>
What’s the best way to parse this text input?
Regex? (I don’t have any experience with regex)
Some Python library?
Or should I write my own parser, “reading” the input and applying logic where needed?
The emphasis element of the language you describe looks like Markdown.
You should consider just using Markdown, as is. There is a Python module that parses it too.