Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. # solution 1
  2. bash-4.2$ perl -lne 'print if (!/(.)(?=$1)/g && /.{10}/)' <<< 'abcdefghij'
  3.  
  4. # solution 2
  5.  
  6. bash-4.2$ perl -lne 'print if (!/(.)(?=\1)/g && /.{10}/)' <<< 'a b c d e '
  7. a b c d e
  8.  
  9. bash-4.2$ perl -lne 'print if (!/(.)(?=\1)/g && /.{10}/)' <<< 'abcdefghij klmno pqrstuvwxyz'
  10. abcdefghij klmno pqrstuvwxyz
  11.  
  12. # solution 3
  13.  
  14. bash-4.2$ perl -lne 'print if ( /(.)(?!$1)/g && /.{10}/)' <<< 'abcdefghij'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement