REPLACE MATCHING LINE¶
Scans a multi-line text block for lines matching a regex pattern and replaces entire matching lines with a specified replacement string. Use this worker to patch LS-DYNA keyword decks or any structured text where a full line containing a token must be swapped out in bulk.
When to use¶
Classification: process.
Tagged: keyword_deck, line, ls-dyna, pattern, process, regex, replace, string_transform.
Inputs¶
| Label | ID | Type | Default | Required | Description |
|---|---|---|---|---|---|
| Source Text | text | text | *KEYWORD *PARAMETER RSFO,1.0 *END | ✓ | Multi-line source text to be searched and modified (e.g. an LS-DYNA *KEYWORD deck); supply the full text block whose lines will be scanned against the pattern. |
| Pattern | search | string | RSFO | ✓ | Regular-expression pattern used to identify target lines; any line containing a match (anchored to the start when Location = ‘Start’) will be replaced in full — default ‘RSFO’ matches lines beginning with that parameter name. |
| Replace | replace | string | RSFO,2.0 | ✓ | Replacement string that overwrites the entire matched line; default ‘RSFO,2.0’ illustrates updating a scalar parameter value in an LS-DYNA *PARAMETER block. |
| Location | location | select | start | ✓ | Controls where within a line the pattern match is anchored; currently supports ‘Start’ (match at the beginning of the line) — leave as default unless future options are added. |
Outputs¶
| Label | ID | Type | Description |
|---|---|---|---|
| text_replace_output_1 | text_replace_output_1 | text | Modified text block with all matched lines replaced by the replacement string; preserves all non-matching lines verbatim. |
Disciplines¶
- cae.preprocessing.deck_authoring
- data.curve.transform
Auto-generated from transformation schema. Worker id: text_replace_line. Schema hash: b36c4986e6cc. Hand-curated docs in workerexamples/ override this page when present.