Wednesday, 3 May 2017

Javascript solution to find each substring between a prefix and suffix

I have a string in below format ,

Hello this #result1# is a sample #result2# string with a lot of # and #result3# i need to find all the values between #

I need javascript or nodejs based solution which can return ['result1' , 'result2' , 'result3'] only.

Rules :

  1. There is no space between expected results
  2. There is no # between expected results.
  3. It should exclude results like ['result1# is a sample #result2# string with a lot of ' , 'result1# is a sample ']


via amit2091

No comments:

Post a Comment