Forum: Cfengine Help Subject: Re: replace_patterns bug? Author: babudro Link to topic: https://cfengine.com/forum/read.php?3,19347,19384#msg-19384
For prosperity: The flaw in my regex judgement was following my logic in a sequential left-to-right fashion, assuming that "\s*" would always match an available space rather than yielding to allow the subsequent [^($x)] to match the space. Michael Potter gave a good and concise answer (in a fork of this topic) when he said (quoting from memory) that regex will always try to find a match. So by allowing the "\s*" to match zero spaces it permitted the regex to match where otherwise it would not match. _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine