I have a string as:
var string = "Digital/ Creative Agencies, Real Estate and other key industries in the market.\r\n\r\nOur Services:\r\n1.Website Design\r\n2.Web Development / Portal Development\r\n3.Content Management Systems (CMS) \r\n4.Mobile Application Development \r\n5.SEO & SMO\r\n6.Online branding\r\n7.Creative works\r\n8.PSD to HTML\r\n\r\nTechnologies:\r\n1. HTML5\r\n2.Joomla\r\n3.PHP5\r\n4.Magento\r\n5.Word Press\r\n6.Drupal\r\n7.Amazon EC2\r\n8.Android & IOS\r\n\r\nWe offer you latest technology and trends. Our Strength is technology, team,timely delivery ofcourse Value for your money."
I want to format it properly asso that the numbered bullets works fine. The resulted string should look like:
...in the market. r\n\r\n
Our Services:
<ol><li>Website Design</li><li>Web Development / Portal Development</li><li>Content Management Systems (CMS) </li><li>Mobile Application Development ... </li><li>PSD to HTML</li></ol>
\r\n\r\nTechnologies:<ol><li>HTML5</li><li>Joomla</li><li>PHP5</li>.....</ol>
So i want to keep \r\n\r\n and just want to replace required \r\n\d. with proper html tags.
I tried extracting the paragraph using var para = string.match(/\r\n\d.*[^\r\n\d.]+\r\n\r\n/g) but it returns last element i.e. 8.PSD to HTML instead of all bullets.
Can you guide what would be good way to replace required tags with html tags?
Should i first try extracting the para using .match() and then replace ? or is it possible to replace them directly using string.replace()