sed strip leading mixed text up to some character

regex, sed

Solution

I would apply the following sed command

s/^[^[]*\[/\[/

It replaces everything up to the first `[` with a single `[`.

$ echo "14:32:38,723 [some text] ERROR - some more" | sed 's/^[^[]*\[/\[/'
[some text] ERROR - some more text 

Problem

I have a line like this: 14:32:38,723 [some text] ERROR - some more text ...... I want to delete everything right up to (but not including) the first "[" (so that the result is a line that begins with [some text] .....) My reading of ``` 's/^.*\d*\s//' ``` is that it should replace everything up a digit followed by a space, but it appears to be applying the replace everywhere in the line i.e. being greedy. I've tried: ``` 's/^.*\s\[//g' ``` but it's stripping that first "[" How do I modify either expression to do what I need? Many thanks

Original source