help with a regex(5) expression

help with a regex(5) expression

Post by Chang A » Fri, 26 Apr 2002 07:59:15



hi

I'm trying to match against a negated word (i.e. match anything except
the word) using regex(5).   I'm able to negate the character class
[^WORD] but I can't seem to figure out how to negate the entire word.

I've tried
[^[.WORD.]]
[^\<WORD\>]
[^(WORD)]

As you can see I'm just floundering now.  Can someone give me a hand
with this?

Chang

 
 
 

help with a regex(5) expression

Post by Barry Margoli » Fri, 26 Apr 2002 08:55:20




>I'm trying to match against a negated word

I just answered this in comp.unix.programmer.  Please don't multi-post.
Also, since you're using regex(3), not the shell, it's off-topic for this
newsgroup.

If you really are using the shell, i.e. grep, see the -v option.

--

Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

1. help with a regex(5) expression

hi

I'm trying to match against a negated word (i.e. match anything except
the word) using regex(5).   I'm able to negate the character class
[^WORD] but I can't seem to figure out how to negate the entire word.

I've tried
[^[.WORD.]]
[^\<WORD\>]
[^(WORD)]

As you can see I'm just floundering now.  Can someone give me a hand
with this?

Chang

2. file creation date

3. Any real world examples of regex() expressions?

4. Ram Drive ?

5. Need some regex help please

6. Help: ./demo/demo: error in loading shared libraries: liballeg-3.9.36.so

7. regex help

8. LINUX->PPP->Worldnet?

9. regex help needed plz

10. help with regex spanning more than one line.

11. regex gurus please HELP

12. Thanks for regex and regcmp help

13. help with regex