Sunday, July 10, 2022

[SOLVED] How to grep between third appear and fourth appear

Issue

I tried to get "hello" ,but this not work ,it between third and fourth appear of character i

echo "ixaifsdaihelloihd" | grep -oP '(?=i{3}).*?(?=i{4})'

Solution

echo "ixaifsdaihelloihd" | cut -d'i' -f4


Answered By - ramsay
Answer Checked By - Marilyn (WPSolving Volunteer)