javascript Find number between 2 special characters and replace it with a href tel [on hold]

Multi tool use
Multi tool use












-5














I need to replace all the phone number between '#' & '#' in the text with a phone link href=tel:phoneNumber
A simple example should be helpful:



var input= "Lorem ipsum dolor sit amet, consectetur #0034112345678# adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud#0034046642212#exercitation ullamco laboris";

var output ="Lorem ipsum dolor sit amet, consectetur <a href="tel:0034112345678">0034112345678</a> adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud<a href="tel:0034046642212">0034046642212</a>exercitation ullamco laboris"


Is there a simple way to do that with regex, thx










share|improve this question







New contributor




AymenG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as too broad by BlackICE, Andreas, Wiktor Stribiżew, Patrick Hund, Toto Dec 27 at 14:50


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.











  • 3




    What have you tried? What didn't work? What did you get? What did you expect? What doesn't work with your code and where is it?
    – Toto
    Dec 27 at 13:31






  • 1




    Possible duplicate of How can I replace a regex substring match in Javascript?
    – Andreas
    Dec 27 at 13:32










  • Use regular expression
    – Rafael Lucini
    Dec 27 at 13:44
















-5














I need to replace all the phone number between '#' & '#' in the text with a phone link href=tel:phoneNumber
A simple example should be helpful:



var input= "Lorem ipsum dolor sit amet, consectetur #0034112345678# adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud#0034046642212#exercitation ullamco laboris";

var output ="Lorem ipsum dolor sit amet, consectetur <a href="tel:0034112345678">0034112345678</a> adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud<a href="tel:0034046642212">0034046642212</a>exercitation ullamco laboris"


Is there a simple way to do that with regex, thx










share|improve this question







New contributor




AymenG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as too broad by BlackICE, Andreas, Wiktor Stribiżew, Patrick Hund, Toto Dec 27 at 14:50


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.











  • 3




    What have you tried? What didn't work? What did you get? What did you expect? What doesn't work with your code and where is it?
    – Toto
    Dec 27 at 13:31






  • 1




    Possible duplicate of How can I replace a regex substring match in Javascript?
    – Andreas
    Dec 27 at 13:32










  • Use regular expression
    – Rafael Lucini
    Dec 27 at 13:44














-5












-5








-5







I need to replace all the phone number between '#' & '#' in the text with a phone link href=tel:phoneNumber
A simple example should be helpful:



var input= "Lorem ipsum dolor sit amet, consectetur #0034112345678# adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud#0034046642212#exercitation ullamco laboris";

var output ="Lorem ipsum dolor sit amet, consectetur <a href="tel:0034112345678">0034112345678</a> adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud<a href="tel:0034046642212">0034046642212</a>exercitation ullamco laboris"


Is there a simple way to do that with regex, thx










share|improve this question







New contributor




AymenG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I need to replace all the phone number between '#' & '#' in the text with a phone link href=tel:phoneNumber
A simple example should be helpful:



var input= "Lorem ipsum dolor sit amet, consectetur #0034112345678# adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud#0034046642212#exercitation ullamco laboris";

var output ="Lorem ipsum dolor sit amet, consectetur <a href="tel:0034112345678">0034112345678</a> adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud<a href="tel:0034046642212">0034046642212</a>exercitation ullamco laboris"


Is there a simple way to do that with regex, thx







javascript regex string tags






share|improve this question







New contributor




AymenG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




AymenG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




AymenG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Dec 27 at 13:28









AymenG

11




11




New contributor




AymenG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





AymenG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






AymenG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




put on hold as too broad by BlackICE, Andreas, Wiktor Stribiżew, Patrick Hund, Toto Dec 27 at 14:50


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






put on hold as too broad by BlackICE, Andreas, Wiktor Stribiżew, Patrick Hund, Toto Dec 27 at 14:50


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 3




    What have you tried? What didn't work? What did you get? What did you expect? What doesn't work with your code and where is it?
    – Toto
    Dec 27 at 13:31






  • 1




    Possible duplicate of How can I replace a regex substring match in Javascript?
    – Andreas
    Dec 27 at 13:32










  • Use regular expression
    – Rafael Lucini
    Dec 27 at 13:44














  • 3




    What have you tried? What didn't work? What did you get? What did you expect? What doesn't work with your code and where is it?
    – Toto
    Dec 27 at 13:31






  • 1




    Possible duplicate of How can I replace a regex substring match in Javascript?
    – Andreas
    Dec 27 at 13:32










  • Use regular expression
    – Rafael Lucini
    Dec 27 at 13:44








3




3




What have you tried? What didn't work? What did you get? What did you expect? What doesn't work with your code and where is it?
– Toto
Dec 27 at 13:31




What have you tried? What didn't work? What did you get? What did you expect? What doesn't work with your code and where is it?
– Toto
Dec 27 at 13:31




1




1




Possible duplicate of How can I replace a regex substring match in Javascript?
– Andreas
Dec 27 at 13:32




Possible duplicate of How can I replace a regex substring match in Javascript?
– Andreas
Dec 27 at 13:32












Use regular expression
– Rafael Lucini
Dec 27 at 13:44




Use regular expression
– Rafael Lucini
Dec 27 at 13:44

















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

e6,Hbsf92I
DlCd0PlZrkOGKnQI S

Popular posts from this blog

Monofisismo

Angular Downloading a file using contenturl with Basic Authentication

Olmecas