Hi, I'm looking for a regex expression that I can use into multi field formula tool to extract the text. The empty/template string looks like this:
{"blocks":[{"key":"14qa","text":"","type":"unstyled","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}}],"entityMap":{}}
If there is text, in this case to be extracted, it looks like this:
{"blocks":[{"key":"c1247","text":"Requires repetitive human interaction to log in to different systems and collect data in a spreadsheet.","type":"unstyled","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}}],"entityMap":{}}
Solved! Go to Solution.
As mentioned, the JSON Parse tool is the easiest option.
If you want to use RegEx in Parse mode, try this expression: (.*)("text":")(.*)(","type")(.*)
Chris
I know it is JSON text, this is a partial result from a RESTful API get but I get this error " JSON Parse (39) Error message: The document is empty. at character position: 0". Moreover I need to apply to mulltiple fields
Thanks @Istwineres,
That context helps. Did you try @ChrisTX 's suggestion?
If that doesn't do it, would you mind to submit a sample file so I can try & help? I'm thinking a macro may be an option too.
I've got this part I'm trying to use in a multi field formula to avoid 8 parse regex tools
Try the Multi Field Formula tool with this function:
REGEX_Replace([_CurrentField_], '(.*)("text":")(.*)(","type")(.*)', "$3")
Chris
Many thanks! I missed the "$3" part of the replace in Regex formula