How to select all permutations that follow certain rules

I’m new to Wolfram Language and still learning.

Suppose I have a set: {a,b,c,...}
I want to get a list of all possible permutations of length N that follow certain rules.
For example:

  • b must neighbor c
  • a must come before c
  • between b and d must be c
  • between a and e must be 6 elements
  • and so on…

Maybe even lists where elements could appear multiple times, not just permutations.

Where can I learn how to use pattern matching?
Is something like this possible/easy?
Could you give examples how I can get those lists?

There is a tutorial about pattern matching :

As for your question, I think you may need to specify an order relation operator, so you want to generate all permutations of Range[n]. It will be easier than using the symbols a, b, c, …

For simple cases you don’t have to, though. For instance if you want all permutations that keep “b” and “c” close together and in that order, you can write :

Cases[Permutations[{a,b,c,d,e}], {___, b, c, ___}]