Re: Re: Look-ahead regex, not matching?

"'Nick Anderson' via help-cfengine" <[email protected]> Wed, 09 Jul 2025 11:47:26 -0500
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <[email protected]>
--=-=-=
Content-Type: multipart/alternative; boundary="==-=-="

--==-=-=
Content-Type: text/plain; charset="UTF-8"



        Thanks, Nick. FYI - I updated to "core" 3.24.2.

        I tried the following scenarios after the update:

        edit_line => my_replace("\*mode:\s+(?!blan.*$).*",
                 edit_line =>
                 my_replace("\*mode:\s+(?!blank.*).*", edit_line
                 => my_replace("\*mode:\s+(?!blan.+).*", edit_line
                 => my_replace("\*mode:\s+(?!blank$).*", edit_line
                 => my_replace("\*mode:\s+(?!blank$).*$",
                 edit_line => my_replace("\*mode:\s+(?!blank).*",

        All of which gave the same error (but did perform the
        edit). On subsequent runs of cf-agent, the file is no
        longer edited/updated. I suspect this is a glitch of some
        sort.

  Yeah, I am not good enough with regex to know without running it for
  myself. But that gist I linked to worked for me when I was playing
  around last night. Hopefully you can adapt it for yourself.

-- 
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/help-cfengine/87a55dqpjw.fsf%40northern.tech.

--==-=-=
Content-Type: text/html; charset="UTF-8"

<blockquote style="border-left: 2px solid gray; padding-left: 4px;">
<p>

</p>

<p>
Thanks, Nick. FYI - I updated to "core" 3.24.2.
</p>

<p>
I tried the following scenarios after the update:
</p>

<p>
edit_line     =&gt; my_replace("\*mode:\s+(?!blan.*\().*",
         edit_line     => my_replace("\*mode:\s+(?!blank.*).*",
         edit_line     => my_replace("\*mode:\s+(?!blan.+).*",
         edit_line     => my_replace("\*mode:\s+(?!blank\)).*",
edit_line     =&gt; my_replace("\*mode:\s+(?!blank\().*\)",
edit_line     =&gt; my_replace("\*mode:\s+(?!blank).*",
</p>

<p>
All of which gave the same error (but did perform the edit). On subsequent runs of cf-agent, the file is no longer edited/updated. I suspect this is a glitch
of some sort.
</p>
</blockquote>

<p>
Yeah, I am not good enough with regex to know without running it for myself. But that gist I linked to worked for me when I was playing around last night. Hopefully you can adapt it for yourself.
</p>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &quot;help-cfengine&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:[email protected]">[email protected]</a>.<br />
To view this discussion visit <a href="https://groups.google.com/d/msgid/help-cfengine/87a55dqpjw.fsf%40northern.tech?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/help-cfengine/87a55dqpjw.fsf%40northern.tech</a>.<br />

--==-=-=--

--=-=-=
Content-Type: text/plain; charset="UTF-8"




--
Nick Anderson | Doer of Things | (+1) 785-550-1767 | https://northern.tech

-- 
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/help-cfengine/87a55dqpjw.fsf%40northern.tech.

--=-=-=--