Skip to main content
deleted 71 characters in body
Source Link

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:

  1. my_name 369 == match
  2. my_name 161 == match
  3. 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

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

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

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.

Input:

  1. my_name 369 == match
  2. my_name 161 == match
  3. 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
added 166 characters in body
Source Link

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

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

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.

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

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

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
edited title
Link

regular expression not- command not found on terminal

Source Link
Loading