Help with parsing regex in tripwire

We have regex that we use to parse compliance policies in tripwire. can you please help to correct the regex :

policy is "Verify That Exported File Systems Specify the ro (read-only) Option"

the regex is

^[#].*-o[\ \t]+(?!ro[\ \t]+|ro[=,]\S+|\S+,ro[=,]\S+|\S+,ro[\ \t]+).*$

this does not work. how do we fix it ?

the dfstab looks like this :

# cat /etc/dfs/dfstab

#       Place share(1M) commands here for automatic execution
#       on entering init state 3.
#
#       Issue the command 'svcadm enable network/nfs/server' to
#       run the NFS daemon processes and the share commands, after adding
#       the very first entry to this file.
#
#       share [-F fstype] [ -o options] [-d "<text>"] <pathname> [resource]
#       .e.g,
#       share  -F nfs  -o rw=engineering  -d "home dirs"  /export/home2

To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags

```text
 and 
```

by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums

I apologize as i am new and needed help desperately as all my options are exhausted. Also those 4 different threads are different scenarios . i can combine them all at once if that is appropriate.

Yes please. They're all nearly the same question and closely related, so the same topic.

reposting with all 4 questions in one :

I am trying to parse below regex's and it does not work with tripwire. can you please verify this and advise what should be changed to fix this :

  1. policy - "Verify That Exported File Systems Specify the ro (read-only) Option" regex - ^[#].-o[\ \t]+(?!ro[\ \t]+|ro[=,]\S+|\S+,ro[=,]\S+|\S+,ro[\ \t]+).$

  2. This test verifies that all exported file systems found in /etc/exports specify a fully qualified domain name containing "thcss.com" or a NIS netgroup. regex - ^[^#].*(?:(?:ro|rw|root)=|:)(?!\b(?:[a-z0-9]+(?:-[a-z0-9]+)*\.)+thecss\.com\b|@[a-z0-9]+)(?:\S+)

  3. This test verifies that exported file systems do not have the "root=" option specified. regex - ^[^#].-o[\ \t]+(?=root=\S+|\S+,root=\S+).

  4. Perform the following to determine if the system is configured as recommended: # grep -v '^#' /etc/dfs/dfstab | grep 'share' | grep -v '/usr/sbin/share' [there should be no output]

need help with regex on this.

the dfstab contains # and blank lines