Building json array from a text string

My Bubble module is expecting a json array in order to update a field list (tags). The input has to be by ID’s from the corresponding Bubble DB and not the tag names.

I am using a Text parser for my first step:

Here my text parser

INput

[
    {
        "text": "Bdsm, Anale",
        "pattern": "[^,]+"
    }
]

And output

[
    {
        "__IMTMATCH__": "Bdsm"
    },
    {
        "__IMTMATCH__": " Anale"
    }
]

As you can see I have an extra space before the second tag.
To get rid of it I’m using a text parser replace module:

But my second tags output is:

[
    {
        "text": "nullAnale"
    }
]

the extra space has been added as “null”.
I tried several approaches to get rid of that null.

the most obvious one:

then i tried

^null
null(?=[A-Za-z])
^\s+

None of them worked…

My ultimate goal is to create a json by matching each tag with its corresponding unique ID from a dictionary (stored in Google Sheets).

for example:

bdsm, anale

should get me

[
    "1707639986234x515782443294774400",
    "1707639986234x515788992048520988"
]

Thanks for help

blueprint (2).json (67.6 KB)

Nobody?
I thought this should be a basic task, but I am missing something crucial apparently…