you could use the Find option List Lines containing string
. If you additionally use the Perl regex engine and use a Perl regex search string with all your patterns in an OR expression, you can find all lines at once and copy it then to clipboard. The OR argumentes for UltraEdit or legacy Unix engine are limited to 2 (only A OR B, but not A OR B OR C OR ...), that's why the Perl engine must be used.
It's also possible to create a macro which in a loop asks you for the search string, marks the lines with the string and when you break the loop, copies all marked lines to windows clipboard and removes the marks.
Here is an example for such a macro. It uses the UltraEdit style regex, because ^c can be used in a regex search&replace only with UltraEdit style.
Please note: The search string you enter is interpreted as UltraEdit style regular expression search string and not a simple text.
For details see my small tutorial for ^s and ^c
. That's no problem when you search for strings which contains only of letters and numbers, but be careful with special characters which must be escaped with ^ when they should be found as characters and are UltraEdit style regular expression characters.
You can extend the macro with additional questions for example with "Use match case? or "Use match word?". You can also use an other regular expression engine or do it without any regular expressions. But this would cause to use submacros because nested loops are not possible and you cannot use ^c in a regular expression replace all with an other regex engine, and so you have to mark the lines in an additional loop with non regex search + insert marker string.
Last the file must be opened with write access because it must be temporarily modified. After macro execution the file is like it was before macro execution. (Except you have a line which starts with #|#, use a different marker string in this case.)
GetString "Enter your search string, # breaks loop!"
Find RegExp "%^(*^c^)"
Replace All "#|#^1"
Find RegExp "%#|##|#"
Replace All "#|#"
Find RegExp "%#|#"
Add UnixReOn or PerlReOn (v12+ of UE) at the end of the macro if you do not use UltraEdit style regular expressions by default - see search configuration. Macro command UnixReOff sets the regular expression option to UltraEdit style.