Learn Advanced Bash by Building a Kitty Ipsum Translator - Build a Kitty Ipsum Translator

Tell us what’s happening:
Hi Guys,

I came across a task in this exercise: echo -e “\nLines that they appear on:” >> kitty_info.txt

To get the lines that meow appears on, the answer is below:

grep -n ‘meow[a-z]*’ kitty_ipsum_1.txt | sed -E ‘s/([0-9]+). */\1/’ >> kitty_info.txt

Can someone explain the sed part of the answer? i tried so much to understand it but nothing so far.

Thanks.

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36

Challenge: Learn Advanced Bash by Building a Kitty Ipsum Translator - Build a Kitty Ipsum Translator

Link to the challenge:

Hi there, I am not an expert in sed but this is using something called regular expressions

This says that you are looking for numbers [0-9]+ (the plus says you want 1 or more of these)
Then the brackets mean that the digits you found are grouped and referenced by the \1 later in the pattern (at least that is my guess. Let me know if it makes sense)

The dot means any character
And star means you want 0 or more of these dots (any character)

Does that help?