javascript doesnt continue even though it should - mysterious
<p>I have written a simple script which goes through a textarea and transports !hash tags! and @person names@ into two separate inputs. </p>

<p>However, unless the first of two regex conditions is met (word starts with '!' and ends with '!' symbol), it does not work for the next condition.</p>

<p>For example code on line 42 console.log(persons_parsed); doesnt execute at all, unless !hash tag! typed into the textarea.</p>

<p>How to make it work, so I could only enter @person name@ and it would fill it in the input#persons_jquery ?</p>

<p>Code in jsfiddle: <a href="http://jsfiddle.net/Yz2jw/1/" rel="nofollow">http://jsfiddle.net/Yz2jw/1/</a></p>

<p>The problematic part</p>

<pre><code>if (tags_parsed.length &gt; 0) {

        var vysledek_tags = null;
        for (i = 0; i &lt; tags_parsed.length; i++) {
            if (vysledek_tags) {
                var vysledek_tags = vysledek_tags + ', ' + tags_parsed[i].replace(/[!]/g, '');
            } else {
                var vysledek_tags = tags_parsed[i].replace(/[!]/g, '');
            }
        }
        $('#tags_jquery').val(vysledek_tags);

    }
    console.log(persons_parsed); // THIS DOESNT RETURN ANY VALUE!!!

    if (persons_parsed.length &gt; 0) {

        var vysledek = null;
        for (i = 0; i &lt; persons_parsed.length; i++) {
            if (vysledek) {
                var vysledek = vysledek + ', ' + persons_parsed[i].replace(/[@]/g, '');
            } else {
                var vysledek = persons_parsed[i].replace(/[@]/g, '');
            }
        }
        $('#persons_jquery').val(vysledek);
</code></pre>

<p>Thank you, 
Jakub</p>
