Both cases are really the same. The second way which you mentioned would need even more replacements.
Here is for first case, you would need to add few replacements to deal with each case depending on how many genres there are. Usually it's up to 4 I think.
So here are 4 replacements for each case (they all must be added in this order - replacement for most genres first [or use arrow keys to move to the top] - otherwise it won't work correctly).
Search for:
Code:
(?i)\[GENRE\](.+?), (.+?), (.+?), (.+?)\[/GENRE\]
Replace with:
Code:
<a href=https://site.com/search.php=$1>$1</a>, <a href=https://site.com/search.php=$2>$2</a>, <a href=https://site.com/search.php=$3>$3</a>, <a href=https://site.com/search.php=$4>$4</a>
Enable regex search.
Search for:
Code:
(?i)\[GENRE\](.+?), (.+?), (.+?)\[/GENRE\]
Replace with:
Code:
<a href=https://site.com/search.php=$1>$1</a>, <a href=https://site.com/search.php=$2>$2</a>, <a href=https://site.com/search.php=$3>$3</a>
Enable regex search.
Search for:
Code:
(?i)\[GENRE\](.+?), (.+?)\[/GENRE\]
Replace with:
Code:
<a href=https://site.com/search.php=$1>$1</a>, <a href=https://site.com/search.php=$2>$2</a>
Enable regex search.
Search for:
Code:
(?i)\[GENRE\](.+?)\[/GENRE\]
Replace with:
Code:
<a href=https://site.com/search.php=$1>$1</a>
Enable regex search.