Details and Options
In ResourceFunction["ReplaceAllOutside"][expr,rules,except], no replacements will be made in subexpressions of expr that match except.
The rules must be of the form lhs→rhs or lhs⧴rhs.
A
List of rules can be given. The rules are tried in order. The result of the first one that applies is returned. If none of the rules apply, the original
expr is returned.
If the rules are given in nested lists, ResourceFunction["ReplaceAllOutside"] is effectively mapped onto the inner lists. Thus ResourceFunction["ReplaceAllOutside"][expr,{{r11,r12},{r21,…},…},except] is equivalent to {ResourceFunction["ReplaceAllOutside"][expr,{r11,r12},except],ResourceFunction["ReplaceAllOutside"][expr,{r21,…},except],…}.
Delayed rules defined with ⧴ can contain /; conditions.