Adding details to an already set Textbox

Adding details to an already set Textbox

Hey there,

I was wondering if maybe you can help me. I'm still no real expert on manipulating strings. This is what I'm trying to do. I have a Textbox that has text something like this

  1. XX.XX.XXXX (european date Format)

  2. Some Text to that date


  4. Some more text to that second date
I wand to wrap a complete Text in a <details> tag, and the date itsself in a <summary>-Tag. So far so good. I created a pattern and get the indexes of the dates by

  1. var pattern = /\d\d.\d\d.\d\d\d\d/g;
  2. var indeces = [];
  3. $(text.match(pattern)).each(function(index){
  4.       indecex[index] = date.indexOf(this);
  5. });
Now i can insert the Tags I want. So far so good. But how can I ensure it only adds the tags if not already added. Is there a not-selector or something similar in a regular expression as well? Would be thankful for help. Thanks in advance and

Greetings Chris