sed not applying /d "delete line" option

So I'm on an AIX machine.

And sed is not applying /d "delete line" option when I also include match word options \< and \>

examples...

echo cat | sed '/\<cat\>/d'

will return cat for some reason

echo cat | sed "/\<cat\>/d"

will also still return cat.

Of course i can just run

echo cat | sed '/cat/d'

nothing returned as the /d 'delete line' option is now is applied.
But I need to match the word exactly.... so what am I doing wrong?

As both your examples work on my linux host, but not on FreeBSD, I presume it's your sed version that doesn't like the word delimiters.

Sorry, I was not meaning to double post, I though it would be better to have thread in 'Shell Programming and Scripting ' then here, "programming" So I was going to delete this thread.
Thanks for the reply. still tying to figure out a work around here.

Hi,

This is certainly a messier and less efficient solution, but in the absence of word boundaries in your sed implementation you could maybe do something like this ?

sed -e "/^cat /d" -e "/ cat$/d" -e "/ cat /d"

So specifically checking for lines starting with 'cat' and then a space; lines ending with a space and then 'cat'; and lastly lines containing 'cat' surrounded by a space on either side. And so on in that fashion, if there are any other cases that would occur in your input (you'd have to consider punctuation marks, etc).

As I say, messy, but you could cobble something together in this way maybe.

Moved thread to desired forum.

Adaption of drysdalk's proposal:

echo "as cat, " | sed -r '/(^|[[:punct:][:space:]])cat([[:punct:][:space:]]|$)/d'

or

echo "cat, " | sed -r '/(^|[^[:alnum:]])cat([^[:alnum:]]|$)/d'

Thanks for the replies drysdalk and rudic.

drysdalk - I was able to achieve what I wanted from the example of your code!, thanks!

 sed -e "/^cat /d" -e "/ cat$/d" -e "/ cat /d"

rudic - Sadly the -r option isn't available for sed in AIX, I wasn't able to get your examples to work.

Is the -E option available instead - both have the meaning "use extended regexes"?

No, I do not see the -E option available in AIX for sed.

I have attached part of the sed man page.

Hi RudiC that is only available with GNU sed and/or BSD sed, not with sed on AIX.

Well, too bad.
Please abstain from posting screen shots or pictures to show texts like code, output, or error messages. Post the text as is to enable people to copy and use it.