Q:

How to write a regex which ignores a partial match? 

Imagine this markdown file:
...

## Questions heading
### Question sub-heading
- some question
- some question
### Question sub-heading
- some question

## Next section heading
- blah
- blah

## Another section heading
- blah
- blah

I need to be able to extract all of the questions in the Questions section, which may sometimes include Question sub-headings. 
My regex is working only if a sub-heading doesn't exist.  Here is my current regex: ##\sQuestions([\s\S]*?)##  which for the above example would return this:
## Questions heading
##

I need it to return the entire section between the two main headings.  Which should look like this:
### Question sub-heading
- some question
- some question
### Question sub-heading
- some question

I need to ignore sub-headings a.k.a ### as those are not main section headings and continue matching until the next main section heading begins, which is denoted as ##. 

A:

This should do the trick, I'm not saying it's pretty but it will work:
/^##\s*Questions.*?\n([^]*?)^##[^#]/m

Test:
var match = `## Questions heading
### Question sub-heading
- some question
- some question
### Question sub-heading
- some question

## Next section heading
- blah
- blah

## Another section heading
- blah
- blah`.match(/^##\s*Questions.*?\n([^]*?)^##[^#]/m);
if (match) {
  console.log(match[1]);
}

It's relying on that ## is at the beginning of the line. 
Breakdown:
/
  ^##\s*Questions.*?\n # Match "## Questions ...\n"
  ([^]*?)               # Match anything including newline
  ^##[^#]              # Match "## ..."
/m                     # Make `^` and `$` work on each line instead of all input

