Version 0 of Regsub -all, Match Line, and Replace, Working on a Text File V2

Updated 2024-03-27 12:53:50 by gold


Title: Regsub -all, Match Line, and Replace, Working on a Text File V2


Find a text in a line and replace the next line

--- gold 3/26/2024. Found example code on Ask11, seemed a useful lesson and example code on regsub and replace, if links were added to find same in the Wiki stacks.


tclamateur : I want to find a text in a line and replace the contents of the next line with a new string. I tried regsub, but it is only matching the first line. I don't know how to go to the next line. eg:


References on Wiki


regsub, a built-in Tcl command, performs substitutions based on regular expression pattern matching.

See Also

regular expressions
information about Tcl regular expressions that is not unique to any particular command
string map
subst

Synopsis

regsub ?switches? exp string subSpec ?varName?

Hidden Comments Section

Please include your wiki MONIKER and date in your comment with the same courtesy that I will give you. Thanks, gold 3/26/2024