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
- XX.XX.XXXX (european date Format)
- Some Text to that date
- XX.XX.XXXX
- 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
- var pattern = /\d\d.\d\d.\d\d\d\d/g;
- var indeces = [];
- $(text.match(pattern)).each(function(index){
- indecex[index] = date.indexOf(this);
- });
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