There is list A, containing text.
There is List B, with Letter combinations.
IF there is a text combination present in list A which is also present in list B I would like to replace the the text in A with the corresponding index B.
So for example;
FD → 0
FC → 1
C → 6
FA → 3
G → 1
But all other text I would like to keep.
So in fact the same thing as the replace text command does, but than for the entire list.
I did find a python sript, which does the trick for ‘single Letters’ see below. However I also neet it for Letter combinations. Maybe by adding some brckets? (unfortunately I am not a python specialist).
From the regexp page I linked you to you may have learned that [ and ] define a set of characters. You have currently [A-Z] as character set. To include ' in the set you…
I read the page an see indeed that $ is special character with a specific meaning.
Unfortunately I do not have any experience with python, so its really hard to find what I really want.
Lets zoom out a bit and see if you see an opportunity
Panel A:
Is a panel containing text.
I would like to be able to modify some text parts of List.
Because of this I would like to introduce a ‘Variable character’ which represents a values (which I can change easily)
How the ‘Variable character’ looks like does not matter to me.
Original I suggested to use
$1
$2
…
but this could also be another character (e.g. €1 _1 '1)before a number. Simply something which makes the character ‘unique’
Thereafter I would like to replace the text with a certain value which is present in another list.
so e.g.
Replace $1 --> 7
Replace $2 --> 9
Do you have any suggestion what character/python adjustment would work?
In fact it the same as the ‘replace text commando does in GH’, unfortunately when there are a lote of ‘Variables’ this would look very ugly…
So I think should be done with python in a smarter way :).
This is not about Python but about regular expressions.
To use $ in a pattern as itself and not the special meaning you need to escape it. That is why I directed you to read up on the character \ as well, a bit further down after the text on $. You should’ve realized that you are supposed to use \$ in a pattern when you want to match the character $.