[Question]
  [
Do you recognize the PPCG logo?
it looks like this, when you do an ascii art of it.
```
+---+
|PCG|
+---+
   v
```
Now, In this Code Golf, You will make a code, that makes logos for other sites, similar to the PPCG logo.
# What You should do
The "Shortened" string will be the string, with all upper case letters and numbers in the input string.(Which would be `PPCG` when the input string is `Programming Puzzles & Code Golf`)
The "Box" (
```
+---+
|   |
+---+
   v
```
)
should fit the Shortened string perfectly.(No bigger or smaller)
Also the `v` part should be exactly 1 down and 1 left to the down right `+`.
Then output the box which has the shortened string in it.
# Example
`Stack Overflow`:
```
+--+
|SO|
+--+
  v
```
`Area 51`:
```
+---+
|A51|
+---+
   v
```
# Rules
You may assume that the input contains at least one digit or upper case letter.
Standard [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") rules apply.
  
[Answer]
# Vim, 42 strokes
```
:s/[^A-Z0-9]//g
YPVr-i+<DOWN><LEFT>|<ESC><C-V>ky$pYjppVr $xrv
```
Replace `<DOWN>` with `↓`, `<LEFT>` with `←`, `<ESC>` with `esc` and `<C-V>` with `CTRL`+`V`.
Here's an animation of this script running (old version which uses a `V` instead of a `v`):
[![Animation](https://i.stack.imgur.com/wrpAG.gif)](https://i.stack.imgur.com/wrpAG.gif)
Explanation of the script:
```
:s/[^A-Z0-9]//g                               # Remove all the characters that are not uppercase or numbers using a Regex.
YPVr-                                         # Duplicate the current, and replace all the characters of the upper one with dashes.
     i+<DOWN><LEFT>|<ESC>                     # Insert a + on the upper line, and a | on the second line.
                         <C-V>ky$p            # Copy the + and | to the end of both lines.
                                  Yjpp        # Copy the upper line to the bottom two times.
                                      Vr $    # Replace the bottom most line with spaces and put the cursor on the last character.
                                          xrv # Remove the last character and replace the second last character with a v.
```
[Answer]
# [V](https://github.com/DJMcMayhem/V) 34 bytes
```
Ó[^A-Z0-9]
ys$|ÄVr-r+$.YLppVr x$rv
```
Note that this worked in an older version, but doesn't work in the current version on try it online. I changed `Ä` to `YP` which is functionally equivalent.
[Try it online!](http://v.tryitonline.net/#code=w5NbXkEtWjAtOV0KeXMkfFlQVnItciskLllMcHBWciB4JHJ2&input=UHJvZ3JhbW1pbmcgUHV6emxlcyAmIENvZGUgR29sZg)
Explanation:
```
Ó[^A-Z0-9]
```
Remove everything except for digits and uppercase characters.
```
ys$|              "Surround this line with '|' characters.
    Ä             "Duplicate this line
     Vr-          "Replace this whole duplicated line with '-' characters
        r+        "replace the first character with '+'
          $       "Move to the end of the line, and
           .      "Repeat our last command. This is the same as 'r+'
            Y     "Yank the current line
              pp  "and paste it twice
             L    "At the end of our text
```
Now, the buffer looks like this:
```
+---+
|A51|
+---+
+---+
```
And our cursor is at the first column of the last line.
```
Vr                 "Change the whole last line to spaces
   x               "Delete a character
    $rv            "And change the last character to a 'v'
```
[Non-competing version: (31 bytes)](http://v.tryitonline.net/#code=w5PChEEtWjAtOV0KeXMkfFlQw5ItciskLllMcHDDkiB4JHJ2&input=UHJvZ3JhbW1pbmcgUHV6emxlcyAmIENvZGUgR29sZg)
[Answer]
# 16-bit x86 machine code, 72 bytes
In hex:
```
565789F731C9FCAC84C074143C5A77F73C4173083C3977EF3C3072EBAA41EBE75F5EE81500B07CAA51F3A4AB59E80A00B020F3AAB076AA91AAC351B02BAAB02DF3AAB82B10AB59C3
```
Parameters: `SI` = input string, `DI` - output buffer.
Outputs a NULL-terminated string with lines delimited by newline.
Uses input string as a temporary buffer.
```
56           push   si
57           push   di
89 f7        mov    di,si    ;Using source string as a buffer
31 c9        xor    cx,cx    ;Counter
fc           cld
_loop:
ac           lodsb
84 c0        test   al,al    ;Test for NULL
74 14        jz     _draw    ;Break
3c 5a        cmp    al,'z'   ;\
77 f7        ja     _loop    ; |
3c 41        cmp    al,'a'    ; \
73 08        jae    _stor    ;  >[A-Z0-9]?
3c 39        cmp    al,'9'   ; /
77 ef        ja     _loop    ; |
3c 30        cmp    al,'0'   ;/
72 eb        jb     _loop
_stor:
aa           stosb           ;Store char in the source buffer
41           inc    cx
eb e7        jmp    _loop
_draw:
5f           pop    di
5e           pop    si
e8 15 00     call   _line    ;Output the first line
b0 7c        mov    al,'|'   ;This proc upon return leaves '\n' in AH
aa           stosb           ;First char of the second line
51           push   cx
f3 a4        rep    movsb    ;Copy CX logo characters from the source buffer
ab           stosw           ;Outputs "|\n", which is still in AX
59           pop    cx
e8 0a 00     call   _line    ;Output the third line
b0 20        mov    al,0x20  ;Space
f3 aa        rep    stosb    ;Output it CX times
b0 76        mov    al,'v'
aa           stosb           ;Output the final 'v'
91           xchg   cx,ax    ;CX == 0
aa           stosb           ;NULL-terminate the string
c3           retn            ;Return to caller
_line:
51           push   cx
b0 2b        mov    al,'+'
aa           stosb
b0 2d        mov    al,'-'
f3 aa        rep    stosb     ;'-'*CX
b8 2b 10     mov    ax,0x102b ;"+\n"
ab           stosw
59           pop    cx
c3           retn
```
[Answer]
# [Retina](https://github.com/m-ender/retina), 43 bytes
```
[^A-Z\d]
.+
+$.&$*-+¶|$&|¶+$.&$*-+¶$.&$* V
```
[Try it online!](http://retina.tryitonline.net/#code=W15BLVpcZF0KCi4rCiskLiYkKi0rwrZ8JCZ8wrYrJC4mJCotK8K2JC4mJCogVg&input=QXJlYSA1MQ)
This is the perfect challenge to demonstrate Retina, Martin Ender's golfing language.
This solution is divided into two steps (what we call stages), both stages being a replacement stage.
The first stage:
```
[^A-Z\d]
```
This matches the substrings which match `[^A-Z\d]`, which is the characters that are not uppercase and not digits, and then substitute them by nothing, meaning deleting them.
The second stage:
```
.+
+$.&$*-+¶|$&|¶+$.&$*-+¶$.&$* V
```
The `.+` matches the whole result, and then substitutes it with the second line.
In the second line:
* `$&` refers to the whole match
* `$.&` refers to the length of the whole match
* `$*` means take the previous integer, repeat the next character that many times. Here `$.&$*-` means to repeat `-` however long the match is.
* `¶` refers to a new-line.
[Answer]
## C#, 183 177 165 bytes
```
string h(string s){s=string.Concat(s.Where(n=>n>47&n<58|n>64 &n<91));int m=s.Length;var x=new string('-',m);return$"+{x}+\n|{s}|\n+{x}+\n{new string(' ', m + 1)}v";}
```
multiplying chars is terrible in C#.
suggestions appreciated
thanks alot to aloisdg for -18 bytes
[Answer]
# Excel VBA, ~~375~~ ~~359~~ 358 bytes:
It works, I give up on trying to make it shorter...
Edit: Switched to case statement from if statements, -16 bytes
Edit2: Got rid of u and replaced with Len(b), -1 byte
```
Function b(x)
For i = 1 To Len(x)
a = Mid(x, i, 1)
e = Asc(a)
If e > 64 And e < 91 Or e > 47 And e < 58 Then b = b & a
Next i
For Z = 1 To 4
y = ""
Select Case Z
Case 2
y = "|" & b & "|"
Case 4
For i = 1 To Len(b)
y = y & " "
Next i
y = y & "v"
Case Else
y = "+"
For i = 1 To Len(b)
y = y & "-"
Next i
y = y & "+"
End Select
Debug.Print y
Next Z
End Function
```
[Answer]
## Lua, ~~145~~ 99 Bytes
Not much to say, manipulating strings is always wordy in lua :). Takes a command-line argument and output via STDOUT
**Thanks to @LeakyNun for saving me 45 Bytes !**
```
n=(...):gsub("[^%u%d]","")s="+"..("-"):rep(#n).."+\n"return s.."|"..n.."|\n"..s..(" "):rep(#n).."V"
```
**100 Bytes proposed by @LeakyNun**
```
n=(...):gsub("[^A-Z%d]","")s="+"..("-"):rep(#n).."+\n"return s.."|"..n.."|\n"..s..(" "):rep(#n).."V"
```
**OLD 145 Bytes**
```
g="|"..(...):gsub("%a+",function(w)return w:sub(1,1)end):gsub("%s",'').."|"S="+"..g.rep("-",#g-2).."+"p=print
p(S)p(g)p(S)p(g.rep(" ",#g-2).."v")
```
### Ungolfed
```
g="|"                            -- g is the second, and starts with a |
  ..(...):gsub("%a+",            -- append the string resulting of the iteration on each word
    function(w)                  -- in the input, applying an anonymous function
      return w:sub(1,1)          -- that return the first character of the word
    end):gsub("%s",'')           -- then remove all spaces
  .."|"                          -- and append a |
S="+"..g.rep("-",#g-2).."+"      -- construct the top and bot of the box
p=print                          -- alias for print
p(S)p(g)p(S)                     -- output the box
p(g.rep(" ",#g-2).."v")          -- output #g-2 spaces (size of the shortened name), then v
```
[Answer]
# [2sable](http://github.com/Adriandmen/2sable), ~~36~~ ~~34~~ ~~33~~ ~~32~~ 31 bytes
Presenting **2sable** :). Although it has a lot in common with 05AB1E, this one actually auto joins the stack rather than outputting the top of the stack. Code:
```
žKA-Ã©g'-×'+DŠJDU„
|Â®sX¶®gð×'v
```
Uses the **CP-1252** encoding.
[Answer]
## JavaScript (ES6), 99 bytes
```
(s,t=s.replace(/[^0-9A-Z]/g,``),g=c=>t.replace(/./g,c))=>`${s=`+${g(`-`)}+
`}|${t}|
${s}${g(` `))v`
```
[Answer]
# Haskell, 107 Bytes
This answer is heavily based on the answer by *Zylviij* and the comments by *nimi*. I would have added more comments to that answer, but alas, I don't have enough rep.
```
o n=t++'|':f++"|\n"++t++(f>>" ")++"v"where f=[c|c<-n,any(==c)$['0'..'9']++['A'..'Z']];t='+':(f>>"-")++"+\n"
```
Additional tricks used:
* Replaced `intersect` by its implementation so the import can be dropped. (Side note: the implementation is nearly verbatim the library one, I couldn't find a shorter version.)
* Moved the helper functions into the `where` clause so functions can use the `n` parameter internally.
* After that, `(#)` was short enough to be inlined.
* Put everything on one line to limit extra whitespace.
[Answer]
# Python 3.5, ~~114~~ ~~93~~ 112 bytes:
```
import re;Y=re.findall('[A-Z0-9]',input());I='+'+'-'*len(Y)+'+\n|';print(I+''.join(Y)+I[::-1]+'\n'+' '*len(Y)+'v')
```
A full program. Basically uses a regular expression to match all occurrences of uppercase letters and numbers, then creates the box of the exact size based on the length of the list of matches, and finally puts the joined list of matches "inside" it.
[Try It Online! (Ideone)](http://ideone.com/3b6z1g)
[Answer]
# Python 3, ~~121~~ 124 bytes
Fixed stupid mistake
```
s=''
for i in input():_=ord(i);s+=("",i)[91>_>64or 47<_<58]
x=len(s)
c='+'+"-"*x+'+'
print(c+"\n|"+s+"|\n"+c+"\n"+" "*x+"v")
```
does not import libraries like other python answer.
[Answer]
# Java 8, 149 bytes
```
s->{s=s.replaceAll("[^A-Z0-9]","");String t="+",r;int l=s.length(),i=l;for(;i-->0;t+="-");for(r=(t+="+\n")+"|"+s+"|\n"+t;++i<l;r+=" ");return r+"v";}
```
[Try it online.](https://tio.run/##jVA9b8IwEN35FScPVSKTiA4dkBsk6NCpgMRWSiUTHGpwbGRfUhWa355e2kidKirZ1n28d37vDrKWyWF3bHMjQ4Anqe1lAKAtKl/IXMG8SwFW6LXdQx71QYgF1Ru6dAJK1DnMwUIGbUgml5CF1KuToQlTYyK2fp0mz6NkvGFDxmLRD8GMcTb0gn4DQwyj7B7fonioMyMK5yOhk2QyEsgzlhCtK/ks6lL@YlnM2SfjgV5KOArO9b0RnrpAYK@w8hY8ZzUTTSt@pJ6qrSGpveLa6R2U5Lm3td6AjHvDHwFVmboK0xO10NjIpnnElt7tvSzLTv@yOp@NCnADD26n4NGZgsXfi/mbv0KZH2FR03qNe78Kn3ol4e72Km48hq1D7NS4ArZK@f9QZj1lUcDsl9IMmvYL)
**Explanation:**
```
s->{                     // Method with String as both parameter and return-type
  s=s.replaceAll("[^A-Z0-9]","");
                         //  Leave only the uppercase letters and digits
  String t="+",          //  Temp-String, starting at "+"
         r;              //  Result-String
  int l=s.length(),      //  Amount of uppercase letters and digits `l`
  i=l;for(;i-->0;t+="-");//  Loop and append `l` amount of "-" to the temp-String
  for(r=(t+="+\n")       //  Append "+" and a new-line to the temp-String
        +"|"+s+"|\n"+t;  //  Set the result to `t`, "|", modified input, "|", new-line, `t`
                         //  all appended to each other
      ++i<l;r+=" ");     //  Loop and append `l` amount of spaces to the result
  return r+"v";}         //  Return the result-String with appended "v"
```
[Answer]
## Pyke, 39 bytes
```
cFDh~u{!Ih(sil\-*\+R\+sj\|i\|++jild*\v+
```
[Try it here!](http://pyke.catbus.co.uk/?code=cFDh%7Eu%7B%21Ih%28sil%5C-%2a%5C%2BR%5C%2Bsj%5C%7Ci%5C%7C%2B%2Bjild%2a%5Cv%2B&input=Area+51&warnings=0)
12 bytes of mini-string creation, 20 bytes of formatting. Joy!
[Answer]
# Pyth, ~~38~~ 37 bytes
```
Jj*\-lK@jrG1UTz"++"jK"||"JtXJ"-+"" v
```
[Try it online.](http://pyth.herokuapp.com/?code=%0A%0AJj%2a%5C-lK%40jrG1UTz%22%2B%2B%22jK%22%7C%7C%22JtXJ%22-%2B%22%22+v&input=99+Bottles+Of+Beer&debug=0)
Note the newline in the start.
[Answer]
## Python 2, 113 bytes
```
def f(n):c=filter(lambda x:x.isupper()^x.isdigit(),n);L=len(c);h='+'+L*'-'+'+\n';return h+'|'+c+'|\n'+h+' '*L+'v'
```
[Answer]
# Jolf, 35 bytes
```
Ά+,Alγ/x"[^A-Z0-9]"1'+'-'|γS*lγ" 'v
```
I need a shorter way to remove all but caps & numbers...
[Answer]
# C, ~~171~~ 163
Function `f()` modifies its input and prints out the result.
```
l;f(char*n){char*p=n,*s=n,c[99];for(;*n;++n)isupper(*n)+isdigit(*n)?*p++=*n:0;*p=0;memset(c,45,l=strlen(s));c[l]=0;printf("+%s+\n|%s|\n+%s+\n%*.cv\n",c,s,c,l,32);}
```
## Test Program
Requires one parameter, the string to use in the favicon:
```
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, const char **argv)
{
    char *input=malloc(strlen(argv[1])+1);
    strcpy(input,argv[1]);
    f(input);
    free(input);
    return 0;
}
```
[Answer]
# Haskell, 161
```
import Data.List
r=replicate
l=length
f n=intersect n$['0'..'9']++['A'..'Z']
t n='+':(r(l$f n)'-')++"+\n"
o n=(t n)++"|"++(f n)++"|\n"++(t n)++(r(l$f n)' ')++"V"
```
### Usage
```
o"Stack Overflow"
+--+
|SO|
+--+
  V
o"Area 51"
+---+
|A51|
+---+
   V
```
[Answer]
# Bash, ~~99~~ 74 bytes
```
s=$(sed s/[^A-Z0-9]//g);a=${s//?/-};echo -e "+$a+\n|$s|\n+$a+\n${s//?/ }v"
```
Usage: Run the above command, type the site name, press enter and then `Ctrl` + `D` (send 'end of file').
[Answer]
# CJam, 41
```
"||"q_'[,65>A,s+--*__"+-"er_@\_,((S*]N*'v
```
[Try it online](http://cjam.aditsu.net/#code=%22%7C%7C%22q_'%5B%2C65%3EA%2Cs%2B--*__%22%2B-%22er_%40%5C_%2C((S*%5DN*'v&input=Programming%20Puzzles%20%26%20Code%20Golf)
[Answer]
# R, 108 bytes
```
cat(x<-gsub("(.*)","+\\1+\n",gsub(".","-",y<-gsub("[^A-Z0-9]","",s))),"|",y,"|\n",x,gsub("."," ",y),"v",sep="")
```
## Explanation
Going from the inside out (because who doesn't love assigning global variables from inside a regex), assuming `s` is our input string:
`y<-gsub("[^A-Z0-9]","",s)` keeps capitals and numbers, assigns the resulting value to y.
`gsub(".","-",y<-...)` replaces all characters with hyphens in the above.
`x<-gsub("(.*)","+\\1+\n",gsub(...))` chucks a `+` on either end of the row of hyphens, and a newline, and we store that as x.
The rest is pretty straightforward, output in the appropriate order, and use the fact that the number of spaces before the `v` will be the same as the length of y.
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog/tree/45273ddf926eb9cb054f17a113540959cf32face), 61 bytes
Linked to the repository at Jul 7 to ensure backward compatibility.
```
lybL:{,."-"}ac:"+"c:"+"rcAw@NNw"|"Bw?wBwNwAwNwL:{," "w}a,"v"w
```
### Non-competing, 53 bytes
```
lL:"-"rjb:"+"c:"+"rcAw@NNw"|"Bw?wBwNwAwNw" ":Ljbw"v"w
```
[Try it online!](http://brachylog.tryitonline.net/#code=bEw6Ii0icmpiOiIrImM6IisicmNBd0BOTncifCJCdz93QndOd0F3TnciICI6TGpidyJ2Inc&input=IkJyYWNoeWxvZyI)
[Answer]
## APL, 52 49 bytes
```
{x⍪2⌽'v'↑⍨≢⍉x←⍉z⍪⍨(z←'+|+')⍪'-','-',⍨⍪⍵/⍨⍵∊⎕D,⎕A}
```
(down to 49 thanks to the comment).
[Answer]
## Perl, 57 bytes
**56 bytes code + 1 for `-p`.**
```
y/a-z //d;$d="-"x y///c;$_="+$d+
|$_|
+$d+
".$"x y///c.v
```
I originally tried to make this only using regexes, but it was much larger than I'd hoped, so I've used some string repetition instead.
[Try it online!](https://tio.run/##K0gtyjH9/79SP1G3SkFfP8VaJcVWSVepQqFSX18/2Vol3lZJWyVFm6tGJb6GC8xS0lOBSeuV/f8fUJSfXpSYm5uZl64QUFpVlZNarJCYl6LgnJ@SquCen5P2L7@gJDM/r/i/bgEA "Perl 5 – Try It Online")
[Answer]
# [MATL](https://github.com/lmendo/MATL), 34 bytes
```
t1Y24Y2hm)T45&Ya'+|+'!wy&h10M~'v'h
```
[**Try it online!**](http://matl.tryitonline.net/#code=dDFZMjRZMmhtKVQ0NSZZYScrfCsnIXd5JmgxME1-J3YnaA&input=J0FyZWEgNTEn)
```
t        % Implicit input. Duplicate
1Y2      % Uppercase letters
4Y2      % Digit characters
h        % Concatenate horizontally: string with uppercase letters and digits
m        % True for input chars that are uppercase letters or digits
)        % Keep only those
T45&Ya   % Pad up and down with character 45, which is '-'. Gives three-row char array
'+|+'!   % Push this string and transpose into a column vector
wy       % Swap, duplicate the second array from the top. This places one copy of the
         % column vector below and one above the three-row char array
&h       % Contatenate all stack arrays horizontally. This gives the box with the text
10M      % Retrieve the string with selected letters
~        % Logical negate. Gives zeros, which will be displayes as spaces
'v'      % Push this character
h        % Concatenate horizontally with the zeros.
         % Implicitly display the box with the text followed by the string containing
         % the zero character repeated and the 'v'
```
[Answer]
## JavaScript (ES6), 119 bytes
```
h=a=>"+"+"-".repeat(a.length)+"+\n";j=a=>(a=a.replace(/[^A-Z0-9]/g,""),h(a)+"|"+a+"|\n"+h(a)+" ".repeat(a.length)+"v");
```
[Answer]
# [J](http://jsoftware.com/), 52 bytes
```
'v'(<3 _2)}4{.1":]<@#~2|'/9@Z'&I.[9!:7@'+++++++++|-'
```
[Try it online!](https://tio.run/##y/r/P81WT0G9TF3Dxlgh3kiz1qRaz1DJKtbGQbnOqEZd39IhSl3NUy/aUtHK3EFdGwZqdNX/pyZn5CukKag7FqUmKpgaqv8HAA)
```
   [9!:7@'+++++++++|-'            Set the box drawing characters.
        '/9@Z'&I.                 Interval index, 1 for numbers, 3 for 
                                  uppercase letters.
          ]  #~2|                 Mod 2, and filter
                                  the characters that correspond to 1s.
           <@                     Put them in a box.
           1":                    Convert to a character matrix, so we can do stuff to it.
           4{.                    Add a 4th line filled with spaces   
       'v'(<3 _2)}                Insert a “v” at 3,−2
```
[Answer]
# Ruby, 81 bytes (78 + `-p` flag)
```
gsub(/[^A-Z\d]/,'')
gsub(/.+/){"+#{k=?-*s=$&.size}+
|#{$&}|
+#{k}+
#{' '*s}v"}
```
[Answer]
## Common Lisp (Lispworks), 159 bytes bytes
```
(defun f(s)(labels((p(c l)(dotimes(i l)(format t"~A"c))))(let((l(length s)))#1=(p"+"1)#2=(p"-"l)#3=(format t"+~%")(format t"|~A|~%"s)#1##2##3#(p" "l)(p"v"1))))
```
ungolfed:
```
(defun f (s)
  (labels ((p (c l)
             (dotimes (i l)
               (format t "~A" c))))
    (let ((l (length s)))
      #1=(p "+" 1)
      #2=(p "-" l)
      #3=(format t "+~%")
      (format t "|~A|~%" s)
      #1#
      #2#
      #3#
      (p " " l)
      (p "v" 1))))
```
Usage:
```
CL-USER 2 > (f "so")
+--+
|so|
+--+
  v
NIL
CL-USER 3 > (f "pcg")
+---+
|pcg|
+---+
   v
NIL
```
]