Jira (PUP-7440) Pattern can't allow empty string but block newlines

2017-04-13 Thread Hunter (Hunner) Haugen (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Hunter (Hunner) Haugen commented on  PUP-7440 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: Pattern can't allow empty string but block newlines  
 
 
 
 
 
 
 
 
 
 
Oops hah, thanks! 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-7440) Pattern can't allow empty string but block newlines

2017-04-11 Thread Henrik Lindberg (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Henrik Lindberg commented on  PUP-7440 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: Pattern can't allow empty string but block newlines  
 
 
 
 
 
 
 
 
 
 
And works with empty string as well. 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-7440) Pattern can't allow empty string but block newlines

2017-04-11 Thread Henrik Lindberg (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Henrik Lindberg commented on  PUP-7440 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: Pattern can't allow empty string but block newlines  
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cat testreg.pp 
 
 
 
 
notice(" " =~ Pattern[/\A[^\n]*\z/]) 
 
 
 
 
notice("\n" =~ Pattern[/\A[^\n]*\z/]) 
 
 
 
 
  
 
 
 
 
henrik$ bundle exec puppet apply testreg.pp 
 
 
 
 
Notice: Scope(Class[main]): true 
 
 
 
 
Notice: Scope(Class[main]): false
 
 
 
 
 
 
 
Seems to work as it should. (first string is one space, second one newline) 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
  

Jira (PUP-7440) Pattern can't allow empty string but block newlines

2017-04-11 Thread Henrik Lindberg (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Henrik Lindberg commented on  PUP-7440 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: Pattern can't allow empty string but block newlines  
 
 
 
 
 
 
 
 
 
 
Don't know if it helps, but "end of string" is a lower case escaped z IIRC 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-7440) Pattern can't allow empty string but block newlines

2017-04-11 Thread Henrik Lindberg (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Henrik Lindberg commented on  PUP-7440 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: Pattern can't allow empty string but block newlines  
 
 
 
 
 
 
 
 
 
 
I think this is unrelated to Pattern - did you try these regexps in Ruby? You should get the same result there. 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-7440) Pattern can't allow empty string but block newlines

2017-04-10 Thread Hunter Haugen (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Hunter Haugen updated an issue 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Puppet /  PUP-7440 
 
 
 
  Pattern can't allow empty string but block newlines  
 
 
 
 
 
 
 
 
 

Change By:
 
 Hunter Haugen 
 
 
 
 
 
 
 
 
 
 I'm trying to use https://docs.puppet.com/puppet/4.9/lang_data_abstract.html#pattern to validate my input, which at least should allow {{''}} but not allow {{"\n"}}Here are some examples that I tried:{code:puppet}notice('' =~ Pattern[/\A\Z/])notice("\n" !~ Pattern[/\A\Z/])notice('' =~ Pattern[/\A[^\n]*\Z/])notice("\n" !~ Pattern[/\A[^\n]*\Z/])notice('' =~ Pattern[/\A[^\n]+\Z/])notice("\n" !~ Pattern[/\A[^\n]+\Z/])notice('' =~ Pattern[/^[^\n]*$/])notice("\n" !~ Pattern[/^[^\n]*$/])notice('' =~ Pattern[/^[^\n]+$/])notice("\n" !~ Pattern[/^[^\n]+$/]){code}Also, {{Pattern[]}} allows multiple arguments, but these regexes are or'd together so it's not possible to use a combination of these either, as it will always be {{true or false}} or {{false or true}} 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-7440) Pattern can't allow empty string but block newlines

2017-04-10 Thread Hunter Haugen (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Hunter Haugen created an issue 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Puppet /  PUP-7440 
 
 
 
  Pattern can't allow empty string but block newlines  
 
 
 
 
 
 
 
 
 

Issue Type:
 
  Bug 
 
 
 

Assignee:
 

 Unassigned 
 
 
 

Created:
 

 2017/04/10 4:42 PM 
 
 
 

Environment:
 
 
puppet 4.9 
 
 
 

Priority:
 
  Normal 
 
 
 

Reporter:
 
 Hunter Haugen 
 
 
 
 
 
 
 
 
 
 
I'm trying to use https://docs.puppet.com/puppet/4.9/lang_data_abstract.html#pattern to validate my input, which at least should allow '' but not allow "\n" 
Here are some examples that I tried: 
 
 
 
 
 
 
notice('' =~ Pattern[/\A\Z/]) 
 
 
 
 
notice("\n" !~ Pattern[/\A\Z/]) 
 
 
 
 
notice('' =~ Pattern[/\A[^\n]*\Z/])