Article 5A9WN [SOLVED] Select exact regex with awk

[SOLVED] Select exact regex with awk

by
Drosera_capensis
from LinuxQuestions.org on (#5A9WN)
Hello everyone,

I would like to use awk to select an exact regex (pattern) in a file, and print the line including the regex.

Unfortunately, as the regex is a variable "$f", I can't use the following expression:

Quote:
/regex/{print} file
I have found this form of awk to pass the variable argument "$f" to awk:
Quote:
awk -v regex="$f" '$0 ~ regex {print}' file
But it is not selecting the exact regex pattern.
Would anyone know how to select the exact pattern?latest?d=yIl2AUoC8zA latest?i=RDX32RYLUqg:8q8IlgrtceE:F7zBnMy latest?i=RDX32RYLUqg:8q8IlgrtceE:V_sGLiP latest?d=qj6IDK7rITs latest?i=RDX32RYLUqg:8q8IlgrtceE:gIN9vFwRDX32RYLUqg
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments