What is the proper syntax for substitution

I am learning glyphs, I am just stuck at Matras in Odia script (Indian language) substitution, I don’t know the proper syntax for substitution like substitution from multiple glyphs.

I think I know how to substitute multiple glyphs with one glyphs like this
sub halant-oriya yya-oriya by yya-oriya.post;
but don’t know the syntax to substitute multiple glyphs with multiple glyphs. like.
I have two glyphs for uMatra are uuMatra-oriya and uuMatra-oriya.001 and I want to achieve like if ka-oriya, halant-oriya, ka-oriya.below and uuMatra-oriya are typed together, the last glyph uuMatra-oriya must be replaced with uuMatra-oriya.002 else if ka-oriya and uuMatra-oriya typed no change uuMatra-oriya must be there.

Here is my syntax below it actually replaces glyphs with uuMatra-oriya.002 always.
**sub** [ halant-oriya ka-oriya.below uuMatra-oriya] **by** [ halant-oriya ka-oriya.below uuMatra-oriya.002];

If, in a string of glyphs, you only want to replace one, then place a single straight quote ' after it, like this:

sub a b c' by d;

This will replace only the c by d.

Additionally, instead of writing something like

sub a by d;
sub b by d;
sub c by d;

you can write

sub [a b c] by d;

Furthermore, you can write

sub [a b c d]' e by f;

This will replace a, b, c or d by an f only if followed by an e.

You can also substitute glyphs like this:

sub [a b c] by [d e f];

This will substitute a by d, b by e and c by f. You have to have the exact same number of glyphs per group (in brackets) for this to work.

2 Likes

The confusion here is that brackets don’t define contextual order, they make a group. That means sub [a b c] by [A B C], as you have it, will replace any a by A, any b by B and any c by C no matter what.

2 Likes

thank you so much it was really helpful. Can you also tell me ignore syntax, please.
I want to keep this line sub halant-oriya ssa-oriya by ssa-oriya.below; but if it followed by ka-oriya glyphs it should ignore. This is my attempt toignore sub ka-oriya' halant-oriya' ssa-oriya';

Thank you