Regex dictionary - first word in string, then translate to other values
K
Kelly Dewees
started a topic
2 months ago
I am trying to make a dictionary that translates incoming data into a gift attribute.
Incoming data will be "IHO a friend" or "IMO a friend" or something else (reference line).
What I want is:
- When incoming starts with IHO, translate to "in honor of"
- When incoming starts with IMO, translate to "in memory of"
- When incoming is neither of those, leave blank
I've repurposed a dictionary that keeps just the first character string (in this example IMO or IHO). I then added replacement values below for "in honor of" replacing "IHO" / "in memory of" replacing "IMO". That's not working, though - I still end up with IHO or IMO.
Any ideas on how to make this work, or a better way to achieve this? I think there must be a way! Here's what I have so far:
Kelly Dewees
I am trying to make a dictionary that translates incoming data into a gift attribute.
Incoming data will be "IHO a friend" or "IMO a friend" or something else (reference line).
What I want is:
- When incoming starts with IHO, translate to "in honor of"
- When incoming starts with IMO, translate to "in memory of"
- When incoming is neither of those, leave blank
I've repurposed a dictionary that keeps just the first character string (in this example IMO or IHO). I then added replacement values below for "in honor of" replacing "IHO" / "in memory of" replacing "IMO". That's not working, though - I still end up with IHO or IMO.
Any ideas on how to make this work, or a better way to achieve this? I think there must be a way! Here's what I have so far: