string.gsub pattern question
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: string.gsub pattern question
- From: Daniel Hertrich <dhertrich@...>
- Date: 2011年9月27日 11:53:11 +0200
Hi list,
probably a trivial question to some of you, but I am stuck on this...
I'd like to replace the endings of lines from a HTML-formatted string,
using string.gsub(), according to the following criterion:
Each line ending on "\n" only, but not on "<br>\n", shall be modified
to end on "<br>\n"
Or in words: All lines should end on "<br>\n", but some lack the
"<br>", and if the "<br>" does not exist yet, generate it.
Anyone can assist me with the pattern to use please?
strung.gsub(strInput, ????, "<br>\n")
Thank you!
Daniel