Article 5F5H0 Having trouble understanding usage of \d to find even and odd number.

Having trouble understanding usage of \d to find even and odd number.

by
was123
from LinuxQuestions.org on (#5F5H0)
Hi Friends,

I have a file wherein i have strings as well as integer and a i am trying to find out all the even number using sed.
For example file.txt has below content

asdfasdfasdfasdf
asdf
45
46
35
24
458654
341
56545
657
79

when using sed -n '/\d*[02468]$/p' file.txt --> working fine
when using sed -n '/^\d*[02468]$/p' file.txt --> No output on terminal.
Also when using sed -n '/\d/p' file.txt --> it prints the first two line which shouldn't be the case i guess.

I am basically a bit confused with \d operation i know i can use [0-9] instead but still want to know where i am getting it wrong.latest?d=yIl2AUoC8zA latest?i=mMm3DaLB-HI:D7s99MLdxvg:F7zBnMy latest?i=mMm3DaLB-HI:D7s99MLdxvg:V_sGLiP latest?d=qj6IDK7rITs latest?i=mMm3DaLB-HI:D7s99MLdxvg:gIN9vFwmMm3DaLB-HI
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