hi dear community,
i need help finding the correct formula, but at least i know that the mid and find function have to be included.
i want to extract the text between both “-”, so for example “11 US” is visible in the “us size field”.
any help is greatly appreciated, if there are any questions regarding my concern, please let me know.
kind regards karim and thanks in advance! :slightly_smiling_face:
Solved! Go to Solution.
it was like Scott said, the problem were the straight quotation marks and the “txt” didnt work out for me as well.
i ended up using the following function, which works now after keeping your tips in mind.
again thank you guys and stay safe! :slightly_smiling_face:
Always check the post preview on the right when editing to see how the text will appear when posted. To get quotes to remain unstyled for formulas or scripts, they must be formatted as preformatted text in the post editor. What you did in your posts was format them as quoted text, not as preformatted text. The preformatted text button in the editor toolbar is this one:
You can also manually do this using graves (the “inverted” apostrophe-like character that shares a key with the tilde on most keyboards: ` ). Single graves are fine for single lines, so that this:
`REGEX_EXTRACT(txt,’- +(.*?)+ -’)`
REGEX_EXTRACT(txt,'- +(.*?)+ -')
You can also add four spaces to the start of a line to format it as preformatted text. While this works easily enough for single lines, it becomes a pain for longer blocks of text. For multi-line formulas/scripts, wrap the lines in grave-triplet pairs, so this:
// Say my name
// Say my name console.log("Heisenberg")