I am trying to grab my_name 369 from file.txt
I input this grep line with regex but it return an error. I have tried using egrep
and it did not work. I only want to capture my_name 369 and it will exclude whatever character that ends at 369. If any character is found behind 369, it will not match my_name 369
Input:
- my_name 369 == match
- my_name 161 == match
- my_name 123 2 != error
Error: ?!.: command not found
This is my code to execute and it worked on regex101
grep -i "^\s*my_name\s+[0-9]+\s*$(?!.)*" file.txt