Dynamically display relevant form elements Here is a group of questions (hidden by default except the first one) with yes|no buttons

&lt;div id="email" class="form-item"&gt;
        &lt;h2&gt;Q with 1 more option?&lt;/h2&gt;
    &lt;input type="button" value="true" data-value="web" /&gt;
    &lt;input type="button" value="no" /&gt;
&lt;/div&gt;
&lt;div id="web" class="form-item"&gt;
        &lt;h2&gt;Q with 2 more option?&lt;/h2&gt;
    &lt;input type="button" value="yes" data-value="analy,seo" /&gt;
    &lt;input type="button" value="no" /&gt;
&lt;/div&gt;
&lt;div id="analy" class="form-item"&gt;
        &lt;h2&gt;Q3?&lt;/h2&gt;
    &lt;input type="button" value="yes" data-value="qwe" /&gt;
    &lt;input type="button" value="no" /&gt;
&lt;/div&gt;
&lt;div id="seo" class="form-item"&gt;
        &lt;h2&gt;Q4?&lt;/h2&gt;
    &lt;input type="button" value="yes" data-value="asd" /&gt;
    &lt;input type="button" value="no" /&gt;
&lt;/div&gt;


and the script to reveal the next relevant question (or multiple questions):

$('.form-item:nth-child(1)').slideDown('fast');

$('input[value="yes"],input[value="true"]').click(function () {
    next_id = $(this).attr('data-value');
    matches = [next_id];
    rx = /[^a-z|^0-9]/g;
    if (patt = next_id.match(rx)) {
        matches = next_id.split(patt[0]);
    }

    i = 0;
    while (matches[i]) {
        $('#' + matches[i]).slideDown('fast');
        i++;
    }
});


Sandbox: http://jsfiddle.net/eapo/pu53rx31/

There is any way to simplify this code?
Comments:

The idea of splitting your data-values with different isolation characters seems silly, just using a comma seems much better, as @76484 suggested, and removing the Regular Expression altogether.

However stepping around that, I can see a few things you could fix up:

Yes and No buttons:

You use yes and no for testing the input, why not use true and false, that way instead of $('input[value="yes"],input[value="true"]'), you can just use $('input[value]').

&lt;input type="button" value="true" data-value="foo" /&gt;
&lt;input type="button" value="false" /&gt;


Regular Expression declaration:

Assuming entire removal of the regular expression isn't possible: you only use rx once, meaning you can just place the expression in the loop:

if (patt = next_id.match(/[^a-z|^0-9]/g)) {


While loops:

while loops are notorious for causing recursion to occur, so you ought to replace it with a for loop.

It also removes the need for two extra lines for declaring the variable and incrementing the variable.

for (var i = 0; matches[i]; i++) {
  $('#' + matches[i]).slideDown('fast');
}