![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Hallo, i have this Code in javascript: //------------------------ starttag="<b>"; endtag="</b>"; str="Hier steht <b>ein Text, der Testzwecken</b> dient"; chosentext="Testzwecken"; pattern=starttag+'.*?[^'+endtag+']'+chosentext; //hier Fehler?? t=str.search(pattern); if (t!=-1){ alert("Offenes Starttag vor chosentext"); }else{ alert("KEIN offenes Starttag vor chosentext"); } //------------------------ I want to find out, if there is a open start-htmltag in front of my chosentext. I think, the regular expression is wrong? Hope somebody can help my. Thank you. |
![]() |
| Thread Tools | |
| Display Modes | |
| |