Skip to main content

Extract text

Return the text before, after or between markers.

Command in the String toolkit · id ooa.string/extract_text · 13 inputs (1 required), 1 output

Inputs​

InputTypeRequiredDefaultWhat it is
TextStringYesSource text.
BeforeStringNoReturn text before this marker.
AfterStringNoReturn text after this marker.
TrimBooleanNotrueTrim whitespace from the result.
After occurrenceNumberNo1Which occurrence of the 'after' marker to start from (1 = first).
Before occurrenceNumberNo1Which occurrence of the 'before' marker to stop at (1 = first).
Ignore caseBooleanNofalseFind the markers without regard to upper/lower case.
If not foundStringNoemptyResult when a marker is missing: empty text, or the whole source text.
Maximum lengthNumberNoKeep at most this many characters of the result.
Remove line breaksBooleanNofalseRemove line breaks from the result.
UntilStringNomarkerWhere the result ends when the 'before' marker is empty or not found: as before (marker), at the end of the line, or at the end of the text.
MarkersStringNoeitherG1 (AA parity): with both markers given, whether either one found is enough, or both must be found (else the marker is missing).
Length modeStringNoup_toG1 (AA parity): keep up to max_length characters, or exactly that many (a shorter result counts as not found).

Outputs​

OutputTypeWhat it is
resultStringExtracted text, empty when a marker is missing.