Re: [Puppet Users] property file provider

David Kavanagh
Tue, 23 Aug 2011 21:47:07 -0000

yes, That''s actually does. I wasn''t finding much to read about
this.

David

On Tue, Aug 23, 2011 at 5:12 PM, Stefan Schulte
<stefan.schulte@taunusstein.net> wrote:
> On Tue, Aug 23, 2011 at 04:27:30PM -0400, David Kavanagh wrote:
>> I understand regular expressions. been doing them a long time in
>> various languages. But, how are the fields determined from this regex?
>>
>> David
>>
>
> You have to put everything you want to capture in parentheses, so
>
>  /^Hello (.*)$/.match(''Hello World'').captures ==
[''World'']
>
> However if you want to just define a block and you don''t
> want to capture it you can use (?: and ) instead of ( and ).
>
> I used that in the regex like in
>
>  (?:\s*=\s*(.*?))?
>
> This means there is an optional equal sign with stuff after it as
> indicated by the quotation mark after the block marked with the
> outer parentheses (?: and ). But I dont want to capture the whole
> block so I just capture what is after the equal sign
> (the inner parentheses).
>
> Does this answers your question?
>
> -Stefan