text:
Find the first word starting with each letter
Given a string, find the first word starting with each letter (case insensitive).
Sample
Using Ferulas flourish in gorgeous gardens. as input:
"Ferulas flourish in gorgeous gardens."
 ^^^^^^^          ^^ ^^^^^^^^
 |                |  |
 |                |  --> is the first word starting with `g`
 |                --> is the first word starting with `i`
 --> is the first word starting with `f`

Then, the output for this sample should be the matched words joined by one single space:
"Ferulas in gorgeous"

Challenge
Both input and output must be a string representation, or the closest alternative in your language.
Program or function allowed.
You can consider a word being at least one of: lowercase or uppercase letters, digits, underscore.
This is code-golf, shortest answer in bytes wins.
Another samples:
input: "Take all first words for each letter... this is a test"
output: "Take all first words each letter is"

input: "Look ^_^ .... There are 3 little dogs :)"
output: "Look _ There are 3 dogs"

input: "...maybe some day 1 plus 2 plus 20 could result in 3"
output: "maybe some day 1 plus 2 could result in 3"

Are trailing/starting spaces allowed? Can I assume words are separated by one space in original string?

Iunderstood it from the examples, so there is  in the comment. What about trimming spaces?

Retina, 28 bytes:

M!i`\b(\w)(?<!\b\1.+)\w*
¶

M! - Match each work and print all words separated by newlines.
i - Ignore case.
\b(\w) - Capture first letter of each word
(?<!\b\1.+) - After matching the letter, check if there wasn't a previous word starting with the same letter. \1.+ ensures at least two characters, so we are skipping the current word.
\w* - match the rest of the word.
The above matches only words - all other characters are removed.
¶\n  - Replace newlines with spaces.

Try it online!

Retina, 45 bytes

i`\b((\w)\w*)\b(?<=\b\2\w*\b.+)

\W+

^ | $

Simply uses a single regex to remove later words starting with the same \w character (case insensitive  with the i option), converts runs of \W to a single space, then removes any leading/trailing space from the result.
Try it online!
Edit: See @Kobi's answer for a shorter version using M!`

Darn it, barely beat me to it! I couldn't figure out the lookbehind though.

I've added another Retina answer - I think that's OK if they are different enough (the basic concept is similar, of course).

@Kobi It's much better, so I'm glad to see it :) Makes me realise how much more I need to learn about Retina's line options and what not.

Could you do this to save a few bytes? i\ \b((\w)\w*)\b(?<=\b\2\w*\b.+)(a space before the first\b`) Are the lines afterwards unnecessary?

@KennyLau Unfortunately, I don't think that works because words aren't necessarily separated by spaces, e.g. a...a -> a

@Sp3000 I see, thanks.

JavaScript (ES6), 73 71 bytes
s=>s.match(u=/\w+/g).filter(w=>u[n=parseInt(w[0],36)]?0:u[n]=1).join` `

Saved 2 bytes thanks to @edc65!
Test

var solution = s=>s.match(u=/\w+/g).filter(w=>u[n=parseInt(w[0],36)]?0:u[n]=1).join` `;
var testCases = [
  "Ferulas flourish in gorgeous gardens.",
  "Take all first words for each letter... this is a test",
  "Look ^_^ .... There are 3 little dogs :)",
  "...maybe some day 1 plus 2 plus 20 could result in 3"
];
document.write("<pre>"+testCases.map(t=>t+"\n"+solution(t)).join("\n\n")+"</pre>");

Using parseInt("_",36) = NaN? Blasphemy!

The fun fact is: it works @Sp3000

Using u=regexp is really clever. Save 2 bytes s=>s.match(u=/\w+/g).filter(w=>u[w=parseInt(w[0],36)]?0:u[w]=1).join' '

@edc65 Thanks. It's actually quite convenient that there are 37 possible outputs for a single base-36 digit.

Pyth, 23 bytes
J:z"\w+"1jdxDJhM.grhk0J

Try it online: Demonstration or Test Suite
J:z"\w+"1 finds all the words in the input using the regex \w+ and stores them in J.
.grhk0J groups the words by their lowercase first letter, hM takes the first from each group, xDJ sorts these words by their index in the input string, and jd puts spaces between them.

Perl 6, 39 bytes
{.words.grep({!%.{.substr(0,1).lc}++})}

42 bytes which fixes the words having to match \w+ and golfs the substr part

MATL, 23 bytes
'\w+'XXtck1Z)t!=XRa~)Zc

This borrows Jakube's idea of using a regexp for removing unwanted characters and splitting at the same time.
Input is a string enclosed by single quotes.
Try it online!
Explanation
'\w+'XX  % find words that match this regexp. Gives a cell array
t        % duplicate
c        % convert into 2D char array, right-padded with spaces
k        % make lowercase
1Z)      % get first column (starting letter of each word)
t!=      % duplicate, transpose, test for equality: all combinations
XR       % set diagonal and below to 0
a~       % true for columns that contain all zeros
)        % use as a logical index (filter) of words to keep from the original cell array
Zc       % join those words by spaces

C, 142 132 122 bytes
10 bytes lighter thanks to @tucuxi!
b[200],k;main(c){for(;~c;isalnum(c)|c==95?k&2?:(k|=!b[c|32]++?k&1?putchar(32):0,7:2),k&4?putchar(c):0:(k&=1))c=getchar();}

Prints a trailing space after the last output word.

you can shave the checks for c>47 and c<58 by using isalnum instead of isalpha

Vim 57 keystrokes
:s/[^a-zA-Z_ ]//g<cr>A <cr>ylwv$:s/\%V\c<c-v><c-r>"\h* //eg<c-v><cr>@q<esc>0"qDk@q

Explanation:
:s/[^a-zA-Z_ ]//g                                 #Remove all invalid chars.
A <cr>                                            #Enter insert mode, and enter
                                                  #a space and a newline at the end
ylwv$:s/\\c%V<c-v><c-r>"\h* //eg<c-v><cr>@q<esc>  #Enter all of this text on the
                                                  #next line

0                                                 #Go to the beginning of the line
"qD                                               #Delete this line into register
                                                  #"q"
k@q                                               #Run "q" as a macro

#Macro
ylw                                               #Yank a single letter
   v$                                             #Visual selection to end of line
     :s/                                          #Substitute regex
       \%V\c                                      #Only apply to the selection and
                                                  #ignore case
            <c-v><c-r>"                           #Enter the yanked letter
                       \h*                        #All "Head of word" chars
                                                  #And a space
                           //                     #Replace with an empty string
                             eg                   #Continue the macro if not found
                                                  #Apply to all matches
                               <c-v><cr>          #Enter a <CR> literal
                                        @q<esc>   #Recursively call the macro

I'm really dissapointed by how long this one is. The "Invalid" chars (everything but a-z, A-Z, _ and space) really threw me off. I'm sure there's a better way to do this:
:s/[^a-zA-Z_ ]//g

Since \h matches all of that expect for the space, but I can't figure out how to put the metachar in a range. If anyone has tips, I'd love to hear em.

why a-zA-Z_ and not \w? digits are valid

Julia, 165 155 151 129 102 bytes
g(s,d=[])=join(filter(i->i!=0,[(c=lcfirst(w)[1])∈d?0:(d=[d;c];w)for w=split(s,r"\W",keep=1<0)])," ")

This is a function that accepts a string and returns a string.
Ungolfed:
function g(s, d=[])
    # Split the string into an array on unwanted characters, then for
    # each word, if the first letter has been encountered, populate
    # this element of the array with 0, otherwise note the first letter
    # and use the word. This results in an array of words and zeros.
    x = [(c = lcfirst(w)[1]) ∈ d ? 0 : (d = [d; c]; w) for w = split(s, r"\W", keep=1<0)]

    # Remove the zeros, keeping only the words. Note that this works
    # even if the word is the string "0" since 0 != "0".
    z = filter(i -> i != 0, x)

    # Join into a string and return
    return join(z, " ")
end

Saved 53 bytes with help from Sp3000!

05AB1E, 40 bytes
Code:
94L32+çJžj-DU-ð¡""Kvy¬Xsl©åï>iX®«Uy}\}ðý

Try it online!
Explanation:
We first generate all characters which should be deleted from the input string using 94L32+ç (Try here). We join this string using J and remove [a-zA-Z0-9_] which is stored in žj (Try here). We remove all the characters that are in the second string from the first string, which will leave us:
!"#$%&'()*+,-./:;<=>?@[\]^`{|}~

That can also be tested here. We Duplicate this and store in to X with the U-command. We then remove all the characters that are in this string from the input. We then split on whitespaces using ð¡ and remove all empty strings (using ""K). We now have this.
This is the clean version of the input, which we will work with. We map over each element using v. This uses y as the string variable. We take the first character of the string using ¬ and push X, which contains a string with all forbidden characters (!"#$%&'()*+,-./:;<=>?@[\]^`{|}~). We check if the lowercase version of the first character, (which will also be ©opied to the register), is in this string using å. Covered by this part: ï>i, if the first letter doesn't exist in the string of forbidden characters (X), we append this letter to the list of forbidden characters (done with X®«U) and we push y on top of the stack.
Finally, when the strings are filtered, we join the stack by spaces with ðý.

... explanation? :-)

@LuisMendo Thanks for reminding me! Done :)

Jelly, 32 31 bytes
ØB;”_
e€¢¬œṗf€¢¹ÐfµZḢŒlQi@€$ịj⁶

Try it online!

C# (LINQPAD) - 136 128 bytes
var w=Util.ReadLine().Split(' ');string.Join(" ",w.Select(s=>w.First(f=>Regex.IsMatch(""+f[0],"(?i)"+s[0]))).Distinct()).Dump();

PHP
Inspired by the use of regex in most of the answers, I originally tried to do this without using regex at all just to show off a neat variation, but the sticking point of not having clean strings as input ruined that idea. Sad.
With function wrapper, 89 bytes
function f($s){foreach(preg_split('/\W/',$s)as$w)$c[lcfirst($w)[0]]++?:$v.=" $w";echo$v;}

Without function wrapper (needing $s pre-declared), 73 bytes
foreach(preg_split('/\W/',$s)as$w)$c[lcfirst($w)[0]]++?:$v.=" $w";echo$v;

Explanation:
foreach(preg_split('/\W/',$s)as$w)$c[lcfirst($w)[0]]++?:$v.=" $w";echo$v;
        preg_split('/\w/',$s)                                             Break input on all non-word characters
foreach(                     as$w)                                        Loop through each 'word'
                                     lcfirst($w)[0]                       Take the first letter of the lowercase version of the word
                                  $c[              ]++?:                  Increment an array element with a key of that letter after checking if it's false-y (0)
                                                        $v.=" $w";        Add the word if the letter wasn't found (if the previous condition evaluated to false)
                                                                  echo$v; Print the new string to screen.

My only regret is that I couldn't find a faster way of checking/converting letter case.

Python, 103 bytes
import re
lambda s,d=[]:[w for w in re.findall("\w+",s)if(d.append(w.lower()[0])or d[-1])not in d[:-1]]

Ruby, 40 bytes
->s{s.scan(/\w+/).uniq{|x|x.ord|32}*' '}

Try it online!
String#ord returns the codepoint of the first character in a string and bitwise or with 32 maps uppercase codepoints to the lowercase ones and 95 (_) to 127, while keeping everything else the same.

Lua, 172 Bytes
It ended up way longer that I wanted...
t={}(...):gsub("[%w_]+",function(w)b=nil for i=1,#t
do b=t[i]:sub(1,1):lower()==w:sub(1,1):lower()and 1 or b
end t[#t+1]=not b and w or nil end)print(table.concat(t," "))

Ungolfed
t={}                           -- initialise the accepted words list
(...):gsub("[%w_]+",function(w)-- iterate over each group of alphanumericals and underscores
  b=nil                        -- initialise b (boolean->do we have this letter or not)
  for i=1,#t                   -- iterate over t
  do
    b=t[i]:sub(1,1):lower()    -- compare the first char of t's i word
       ==w:sub(1,1):lower()    -- and the first char of the current word
           and 1               -- if they are equals, set b to 1
           or b                -- else, don't change it
  end
  t[#t+1]=not b and w or nil   -- insert w into t if b isn't set
end)

print(table.concat(t," "))     -- print the content of t separated by spaces

Ruby 76 Bytes
s;f={};s.scan(/(([\w])[\w]*)/).map{|h,i|f[j=i.upcase]?nil:(f[j]=!p; h)}.compact.*' '

Or with method definition 88 bytes
def m s;f={};(s.scan(/((\w)\w*)/).map{|h,i|f[j=i.upcase]?nil:(f[j]=1; h)}-[p]).*' ';end

Ungolfed and with unit test:
def m_long(s)
  #found  - Hash with already found initials
  f={}
  #h=hit, i=initial, j=i[0].downcase
  s.scan(/(([\w\d])[\w\d]*)/).map{|h,i|
    f[j=i.upcase] ? nil : (f[j] = true; h)
  }.compact.join(' ')
end
#true == !p
#~ def m(s)
  #~ f={};s.scan(/(([\w\d])[\w\d]*)/).map{|h,i|f[j=i.upcase]?nil:(f[j]=!p; h)}.compact.join' '
#~ end
def m s;f={};s.scan(/(([\w\d])[\w\d]*)/).map{|h,i|f[j=i.upcase]?nil:(f[j]=!p; h)}.compact.join' ';end

#~ s = "Ferulas flourish in gorgeous gardens."
#~ p s.split

require 'minitest/autorun'
class FirstLetterTest < Minitest::Test
  def test_1
    assert_equal("Ferulas in gorgeous",m("Ferulas flourish in gorgeous gardens."))
    assert_equal("Ferulas in gorgeous",m_long("Ferulas flourish in gorgeous gardens."))
  end
  def test_2
    assert_equal("Take all first words each letter is",m("Take all first words for each letter... this is a test"))
    assert_equal("Take all first words each letter is",m_long("Take all first words for each letter... this is a test"))
  end
  def test_3
    assert_equal("Look _ There are 3 dogs",m("Look ^_^ .... There are 3 little dogs :)"))
    assert_equal("Look _ There are 3 dogs",m_long("Look ^_^ .... There are 3 little dogs :)"))
  end
  def test_4
    assert_equal("maybe some day 1 plus 2 could result in 3",m("...maybe some day 1 plus 2 plus 20 could result in 3"))
    assert_equal("maybe some day 1 plus 2 could result in 3",m_long("...maybe some day 1 plus 2 plus 20 could result in 3"))
  end
end

In Regex, \w includes number characters, so [\w\d] can be replaced with \w. Also, if nil values are in an array when you call join' ' (or better yet, *' ' is a shorthand you can use to save more bytes), they vanish, so the call to compact is unnecessary.

@KevinLau Thanks. The \w\dis embarrassing for me. But if I remove the compact I get additional spaces, (see ['x',nil,'x']*'y' == 'xyyx'). Or did I miss something?

Whoops, you're right. In that case, (list-[p]) saves bytes over list.compact. Also, /\w/ is equivalent to /[\w]/. Finally, you can replace your nil with p and your !p with 1 (since your hash only needs truthy values in it)

Thanks, I added your remarks, The replacement of nil with p does not work. If I use it inside my code I get a syntax error. I have to encapsulate like (p) - but then I have again 3 characters.

Flip the ternary and then it works to save a byte: !f[j=i.upcase]?(f[j]=1;h):p. Also just thought of this, but because of string indexing, using s.scan(/\w+/) and removing the i in favor of h[0] works too.

Seriously, 43 bytes
6╙¬▀'_+,;)-@s`;0@Eùk`M┬i;╗;lrZ`i@╜í=`M@░' j

Try it online!
The lack of regex capabilities made this much more difficult than it needed to be.
Explanation:
6╙¬▀'_+,;)-@s`;0@Eùk`M┬i;╗;lrZ`i@╜í=`M@░' j
6╙¬▀                                         push digits in base 62 (uppercase and lowercase letters and numbers)
    '_+                                      prepend underscore
       ,;)                                   push two copies of input, move one to bottom of stack
          -                                  get all characters in input that are not letters, numbers, or underscores
           @s                                split input on all occurrences of non-word characters
             `;0@Eùk`M                       for each word: push the first letter (lowercased)
                      ┬i                     transpose and flatten (TOS is list of first letters, then list of words)
                        ;╗                   push a copy of the first letters list to register 0
                          ;lrZ               zip the list of first letters with their positions in the list
                              `i@╜í=`M       for each first letter: push 1 if that is the first time the letter has been encountered (first index of the letter matches its own index) else 0
                                      @░     filter words (take words where corresponding element in the previous list is truthy)
                                        ' j  join on spaces

grep and awk, 68 56 bytes
The script:
echo `grep -o '\w*'|awk '!x[tolower(substr($0,1,1))]++'`

Explanation:

grep -o matches the legal words, printing each on its own line.
awk takes the first letter of each line with substr, makes it lowercase, and then increments a hashtable entry with that key.  If the value was unset before the increment, the line is printed.
echo ... turns the lines back into words

I previously tried to create a solution without awk, using uniq, sort, grep and bash but fell just short.  History in the edits.
Thanks to Dennis for some improvements I missed.

Japt v2.0a0 -S, 19 16 bytes
f/\w+/
üÈÎvÃmÎnU

Try it or run all test cases
f/\w+/\nüÈÎvÃmÎnU     :Implicit input of string U                  > "Ferulas flourish in gorgeous gardens."
f/\w+/                :Match /\w+/g                                > ["Ferulas","flourish","in","gorgeous","gardens"]
      \n              :Reassign to U
        ü             :Group and sort by
         È            :Passing each through the following function
          Î           :  First character                           >   ["F","f","i","g","g"]
           v          :  Lowercase                                 >   ["f","f","i","g","g"]
            Ã         :End function                                > [["Ferulas","flourish"],["gorgeous","gardens"],["in"]]
             m        :Map
              Î       :  First element                             > ["Ferulas","gorgeous","in"]
               nU     :Sort by index in U                          > ["Ferulas","in","gorgeous"]
                      :Implicit output joined with spaces          > "Ferulas in gorgeous"

Perl 5 -n, 44 37 bytes
/./&&!$k{lc$&}++&&print$_,$"for/\w+/g

Try it online!

K (ngn/k), 55 bytes
{" "/w@.*'" "_=_*'w:" "\c(c:`c$&2!&48,27\3988544219)?x}

Try it online!

(c:`c$&2!&48,27\3988544219) a compressed version of "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz", stored in c
c(...)?x replace all non-alphanumeric/underscore characters with spaces
w:" "\ split the converted input on spaces, storing in w
=_*'w build a dictionary mapping the distinct (lowercased) leading characters to their words' position(s) within the input sentence
" "_ remove/ignore spaces
w@.*' retrieve the first word beginning with each distinct character...
" "/ ...joining them together with spaces (to be implicitly returned)

Vyxal S, 16 bytes
kr‛ _+↔⇩⌈:vhÞU*'

Try it Online!
Explanation:
kr‛ _+↔           # Remove any non A-Z,a-z,0-9,_, or space chars
       ⇩          # Lowercase
        ⌈         # Split on spaces
         :        # Duplicate
          vh      # Get the first letter of each
            ÞU    # Nub Sieve (Unique mask)
              *   # Multiply mask with list of words
               '  # Remove all empty strings
                  # 'S' flag - join top of stack with spaces and print

Python 3.5, 138 bytes:
import re;lambda o,t=[]:''.join([y[0]for y in[(u+' ',t.append(u[0].lower()))for u in re.sub('\W+',' ',o).split()if u[0].lower()not in t]])

Basically, what's happening is..

Using a simple regular expression, the program replaces all the characters, except lowercase or uppercase letters, digits, or underscores in the given string with spaces, and then splits the string at those spaces.
Then, using list comprehension, create a list that iterates through all the words in the split string, and add the first letters of each word to list "t".
In the process, if the current word's first letter is NOT already in the list "t", then that word and a trailing space are added to the current list being created. Otherwise, the list continues on appending the first letters of each word to list "t".
Finally, when all words in the split have been iterated through, the words in the new list are joined into a string and returned.

PHP 120bytes
function a($s){foreach(preg_split('/\W/',$s)as$w)if(!$o[ucfirst($w[0])]){$o[ucfirst($w[0])]=$w;}return implode(" ",$o);}

This generates a bunch of warnings but that's fine.

Is the function necessary?

Javascript ES6, 108 107 chars
107 chars, result string is trimmed
r=s=>s.split``.reverse().join``
f=s=>r(r(s).replace(/\b\w*(\w)\b(?=.*\1\b)/gi,'')).replace(/\W+/g,' ').trim()

Test:
["Take all first words for each letter... this is a test",
"Look ^_^ .... There are 3 little dogs :)",
"...maybe some day 1 plus 2 plus 20 could result in 3"
].map(f) + '' == [
"Take all first words each letter is",
"Look _ There are 3 dogs",
"maybe some day 1 plus 2 could result in 3"
]

f= doesn't count.

fixed link from above comment since the url has changed and the old one may not be secure (browser displays a warning for me)

@thejonymyster, yep, nice.

Tcl, 150 bytes
proc F {s D\ {}} {lmap w [split $s] {regsub -all \[^\\w] $w "" f
if {![dict e $D [set k [string tol [string in $f 0]]]]} {dict se D $k $f}}
dict v $D}

Try it online!

Python 3, 131 bytes
lambda s:' '.join(sorted({w[0].lower():w for w in''.join(c*(c.isalnum()or c in'_ ')for c in s).split()[::-1]}.values(),key=s.find))

Try it online!
Solution without regex.

Husk, 22 bytes
wÖ€₁¹m←ko_←₁
mf§|='_□w

Try it online!
The '_' requirement is a bit annoying, otherwise a pretty interesting challenge.
Explanation
function ₁: filter nonalphanumerics and split
mf§|='_□w
        w split on spaces
mf        map and filter each letter in the words by:
       □  is it alphanumeric?
  §|      or:
    ='_   is it an underscore?

main function:
wÖ€₁¹m←ko_←₁
           ₁ format the input
       ko    key the words on:
         _←  first letter, lowercased
     m←      map each to first word
 Ö           order by:
  €₁¹        their index in the formatted input
w            join back with spaces

Python, 93 bytes
import re
s=""
for w in re.findall("\w+",input()):
 if(a:=w[0].lower())not in s:s+=a;print(w)


text:
Greatest Common Divisor
Your task is to compute the greatest common divisor (GCD) of two given integers in as few bytes of code as possible.
You may write a program or function, taking input and returning output via any of our accepted standard methods (including STDIN/STDOUT, function parameters/return values, command-line arguments, etc.).
Input will be two non-negative integers. You should be able to handle either the full range supported by your language's default integer type, or the range [0,255], whichever is greater. You are guaranteed that at least one of the inputs will be non-zero.
You are not allowed to use built-ins that compute either the GCD or the LCM (least common multiple).
Standard code-golf rules apply.
Test Cases
0 2     => 2
6 0     => 6
30 42   => 6
15 14   => 1
7 7     => 7
69 25   => 1
21 12   => 3
169 123 => 1
20 142  => 2
101 202 => 101

If we're allowing asm to have inputs in whatever registers are convenient, and the result in whatever reg is convenient, we should definitely be allowing functions, or even code fragments (i.e. just a function body).  Making my answer a complete function would add about 4B with a register calling convention like MS's 32bit vectorcall (one xchg eax, one mov, and a ret), or more with a stack calling convention.

@PeterCordes Sorry, I should have been more specific.  You can totally just write the bear necessary code but if you would be so kind as to include a way to run said code it would be nice.

So count just the gcd code, but provide the surrounding code so people can verify / experiment / improve?  BTW, your test-cases with zero as one of the two inputs break our x86 machine code answers.  div by zero raises a hardware exception.  On Linux, your process gets a SIGFPE.

@Martin Doesn't your edit make it impossible to implement this in languages where the default integer type is immutable and only limited by the available memory?

@CodesInChaos Memory and time limitations are usually ignored as long as the algorithm itself can in principle handle all inputs. The rule is just meant to avoid people hardcoding arbitrary limits for loops that artificially limits the algorithm to a smaller range of inputs. I don't quite see how immutability comes into this?

gcd(0,n) is error not n

@user58988 Actually, gcd(0,n) is really n. Any number can divide 0 without error, because 0 divided by any number gives 0. An error can only occur when we try to divide any number by zero, which isn't the case in the GCD algorithm

Retina, 16
^(.+)\1* \1+$
$1

This doesn't use Euclid's algorithm at all - instead it finds the GCD using regex matching groups.
Try it online. - This example calculates GCD(8,12).
Input as 2 space-separated integers.  Note that the I/O is in unary.  If that is not acceptable, then we can do this:
Retina, 30
\d+
$*
^(.+)\1* \1+$
$1
1+
$.&

Try it online.
As @MartinBüttner points out, this falls apart for large numbers (as is generally the case for anything unary).  At very a minimum, an input of INT_MAX will require allocation of a 2GB string.

I would like to vote for this more

Should be fine with the number range now. I've changed the spec (with the OPs permission) to require only the language's natural number range (or [0,255] if that's more). You'll have to support zeroes though, although I think changing your +s to *s should do. And you can significantly shorten the last stage of the long code by reducing it to 1.

For future reference, I just found an alternative 16-byte solution that works for an arbitrary number of inputs (including one) so it might be more useful in other contexts: http://retina.tryitonline.net/#code=XigxKykoID9cMSkqJAokMQ&input=MTExMTExMTEgMTExMTExMTExMTEx

Just noticed that neither your solutions nor the one in my comment above needs the ^, because it's impossible for the match to fail from the starting position.

i386 (x86-32) machine code, 8 bytes  (9B for unsigned)
+1B if we need to handle b = 0 on input.
amd64 (x86-64) machine code, 9 bytes (10B for unsigned, or 14B 13B for 64b integers signed or unsigned)
10 9B for unsigned on  amd64 that breaks with either input = 0

Inputs are 32bit non-zero signed integers in eax and ecx.  Output in eax.
## 32bit code, signed integers:  eax, ecx
08048420 <gcd0>:
 8048420:       99                      cdq               ; shorter than xor edx,edx
 8048421:       f7 f9                   idiv   ecx
 8048423:       92                      xchg   edx,eax    ; there's a one-byte encoding for xchg eax,r32.  So this is shorter but slower than a mov
 8048424:       91                      xchg   ecx,eax    ; eax = divisor(from ecx), ecx = remainder(from edx), edx = quotient(from eax) which we discard
    ; loop entry point if we need to handle ecx = 0
 8048425:       41                      inc    ecx        ; saves 1B vs. test/jnz in 32bit mode
 8048426:       e2 f8                   loop   8048420 <gcd0>
08048428 <gcd0_end>:
 ; 8B total
 ; result in eax: gcd(a,0) = a

This loop structure fails the test-case where ecx = 0.  (div causes a #DE hardware execption on divide by zero.   (On Linux, the kernel delivers a SIGFPE (floating point exception)).  If the loop entry point was right before the inc, we'd avoid the problem.  The x86-64 version can handle it for free, see below.
Mike Shlanta's answer was the starting point for this.  My loop does the same thing as his, but for signed integers because cdq is one byter shorter than xor edx,edx.  And yes, it does work correctly with one or both inputs negative.  Mike's version will run faster and take less space in the uop cache (xchg is 3 uops on Intel CPUs, and loop is really slow on most CPUs), but this version wins at machine-code size.
I didn't notice at first that the question required unsigned 32bit.  Going back to xor edx,edx instead of cdq would cost one byte.  div is the same size as idiv, and everything else can stay the same (xchg for data movement and inc/loop still work.)
Interestingly, for 64bit operand-size (rax and rcx), signed and unsigned versions are the same size.  The signed version needs a REX prefix for cqo (2B), but the unsigned version can still use 2B xor edx,edx.
In 64bit code, inc ecx is 2B: the single-byte inc r32 and dec r32 opcodes were repurposed as REX prefixes.  inc/loop doesn't save any code-size in 64bit mode, so you might as well test/jnz.  Operating on 64bit integers adds another one byte per instruction in REX prefixes, except for loop or jnz.  It's possible for the remainder to have all zeros in the low 32b (e.g. gcd((2^32), (2^32 + 1))), so we need to test the whole rcx and can't save a byte with test ecx,ecx.  However, the slower jrcxz insn is only 2B, and we can put it at the top of the loop to handle ecx=0 on entry:
## 64bit code, unsigned 64 integers:  rax, rcx
0000000000400630 <gcd_u64>:
  400630:       e3 0b                   jrcxz  40063d <gcd_u64_end>   ; handles rcx=0 on input, and smaller than test rcx,rcx/jnz
  400632:       31 d2                   xor    edx,edx                ; same length as cqo
  400634:       48 f7 f1                div    rcx                      ; REX prefixes needed on three insns
  400637:       48 92                   xchg   rdx,rax
  400639:       48 91                   xchg   rcx,rax
  40063b:       eb f3                   jmp    400630 <gcd_u64>
000000000040063d <gcd_u64_end>:
## 0xD = 13 bytes of code
## result in rax: gcd(a,0) = a

Full runnable test program including a main that runs printf("...", gcd(atoi(argv[1]), atoi(argv[2])) ); source and asm output on the Godbolt Compiler Explorer, for the 32 and 64b versions.  Tested and working for 32bit (-m32), 64bit (-m64), and the x32 ABI (-mx32).
Also included: a version using repeated subtraction only, which is 9B for unsigned, even for x86-64 mode, and can take one of its inputs in an arbitrary register.  However, it can't handle either input being 0 on entry (it detect when sub produces a zero, which x - 0 never does).
GNU C inline asm source for the 32bit version (compile with gcc -m32 -masm=intel)
int gcd(int a, int b) {
    asm (// ".intel_syntax noprefix\n"
        // "jmp  .Lentry%=\n" // Uncomment to handle div-by-zero, by entering the loop in the middle.  Better: `jecxz / jmp` loop structure like the 64b version
        ".p2align 4\n"                  // align to make size-counting easier
         "gcd0:   cdq\n\t"              // sign extend eax into edx:eax.  One byte shorter than xor edx,edx
         "        idiv    ecx\n"
         "        xchg    eax, edx\n"   // there's a one-byte encoding for xchg eax,r32.  So this is shorter but slower than a mov
         "        xchg    eax, ecx\n"   // eax = divisor(ecx), ecx = remainder(edx), edx = garbage that we will clear later
         ".Lentry%=:\n"
         "        inc     ecx\n"        // saves 1B vs. test/jnz in 32bit mode, none in 64b mode
         "        loop    gcd0\n"
        "gcd0_end:\n"
         : /* outputs */  "+a" (a), "+c"(b)
         : /* inputs */   // given as read-write outputs
         : /* clobbers */ "edx"
        );
    return a;
}

Normally I'd write a whole function in asm, but GNU C inline asm seems to be the best way to include a snippet which can have in/outputs in whatever regs we choose.  As you can see, GNU C inline asm syntax makes asm ugly and noisy.  It's also a really difficult way to learn asm.
It would actually compile and work in .att_syntax noprefix mode, because all the insns used are either single/no operand or xchg.  Not really a useful observation.

@MikeShlanta: Thanks.  If you like optimizing asm, have a look at some of my answers over on stackoverflow. :)

@MikeShlanta: I found a use for jrcxz after all in the uint64_t version :).  Also, didn't notice that you'd specified unsigned, so I included byte counts for that, too.

Why couldn't you use jecxz in the 32-bit version to the same effect?

@CodyGray: inc/loop is 3 bytes in the 32-bit version, but 4B in the 64-bit version.  That means that in the 64-bit version only, it doesn't cost extra bytes to use jrcxz and jmp instead of inc / loop.

Can't you point to the middle as entry?

@l4m2: Yes, you can.  But not with inline asm.  Good point, I should update this answer to leave out the +1B for handling 0 on entry.  Oh, but this is only a snippet, not a function, and in asm it's not free if the surrounding code can't just fall into / out of it.  If I want it to be a function, I need to include a ret.  (This was one of my first answers.  I normally post functions now, but this question was originally written to allow a snippet, not a function.)

The current question seem doesn't say to allow snippet

@l4m2: yeah, I know, but I'm just going to leave it alone.  I'm going to let myself get away with it on a technicality, because it's just one byte either way, and I don't want to take the time to re-edit the answer.  It wasn't the OP's edit that changed it; it was originally written as an ASM-encouraging question, but a mod changed it to be a normal code-golf question.  I answered the original question, so I think it's fine to leave it.

Hexagony, 17 bytes
?'?>}!@<\=%)>{\.(

Unfolded:
  ? ' ?
 > } ! @
< \ = % )
 > { \ .
  ( . .

Try it online!
Fitting it into side-length 3 was a breeze. Shaving off those two bytes at the end wasn't... I'm also not convinced it's optimal, but I'm sure I think it's close.
Explanation
Another Euclidean algorithm implementation.
The program uses three memory edges, which I'll call A, B and C, with the memory pointer (MP) starting out as shown:

Here is the control flow diagram:

Control flow starts on the grey path with a short linear bit for input:
?    Read first integer into memory edge A.
'    Move MP backwards onto edge B.
?    Read second integer into B.

Note that the code now wraps around the edges to the < in the left corner. This < acts as a branch. If the current edge is zero (i.e. the Euclidean algorithm terminates), the IP is deflected to the left and takes the red path. Otherwise, an iteration of the Euclidean algorithm is computed on the green path.
We'll first consider the green path. Note that > and \ all acts as mirrors which simply deflect the instruction pointer. Also note that control flow wraps around the edges three times, once from the bottom to the top, once from the right corner to the bottom row and finally from the bottom right corner to the left corner to re-check the condition. Also note that . are no-ops.
That leaves the following linear code for a single iteration:
{    Move MP forward onto edge C.
'}   Move to A and back to C. Taken together this is a no-op.
=    Reverse the direction of the MP so that it now points at A and B.
%    Compute A % B and store it in C.
)(   Increment, decrement. Taken together this is a no-op, but it's
     necessary to ensure that IP wraps to the bottom row instead of
     the top row.

Now we're back where we started, except that the three edges have changed their roles cyclically (the original C now takes the role of B and the original B the role of A...). In effect, we've relpaced inputs A and B with B and A % B, respectively.
Once A % B (on edge C) is zero, the GCD can be found on edge B. Again the > just deflects the IP, so on the red path we execute:
}    Move MP to edge B.
!    Print its value as an integer.
@    Terminate the program.

T-SQL, 153 169 bytes
Someone mentioned worst language for golfing?
CREATE FUNCTION G(@ INT,@B INT)RETURNS TABLE RETURN WITH R AS(SELECT 1D,0R UNION ALL SELECT D+1,@%(D+1)+@B%(D+1)FROM R WHERE D<@ and D<@b)SELECT MAX(D)D FROM R WHERE 0=R

Creates a table valued function that uses a recursive query to work out the common divisors.  Then it returns the maximum.
Now uses the euclidean algorithm to determine the GCD derived from my answer here.
Example usage
SELECT *
FROM (VALUES
        (15,45),
        (45,15),
        (99,7),
        (4,38)
    ) TestSet(A, B)
    CROSS APPLY (SELECT * FROM G(A,B))GCD

A           B           D
----------- ----------- -----------
15          45          15
45          15          15
99          7           1
4           38          2

(4 row(s) affected)

Jesus that is verbose.

Jelly, 7 bytes
ṛß%ðḷṛ?

Recursive implementation of the Euclidean algorithm. Try it online!
If built-ins weren't forbidden, g (1 byte, built-in GCD) would achieve a better score.
How it works
ṛß%ðḷṛ?  Main link. Arguments: a, b

   ð     Convert the chain to the left into a link; start a new, dyadic chain.
 ß       Recursively call the main link...
ṛ %        with b and a % b as arguments.
     ṛ?  If the right argument (b) is non-zero, execute the link.
    ḷ    Else, yield the left argument (a).

That almost feels like cheating haha, I may have to specify that answers can't use butlins...

If you decide to do so, you should do it quickly. It would currently invalidate three of the answers.

Notice he specified length is in bytes -- those characters are mostly > 1 byte in UTF8.

@cortices Yes, all code golf contests are scored in bytes by default. However, Jelly doesn't use UTF-8, but a custom code page that encodes each of the 256 characters it understands as a single byte.

32-bit little-endian x86 machine code, 14 bytes
Generated using nasm -f bin
d231 f3f7 d889 d389 db85 f475
    gcd0:   xor     edx,edx
            div     ebx
            mov     eax,ebx
            mov     ebx,edx
            test    ebx,ebx
            jnz     gcd0

I got this down to 8 bytes by using cdq and signed idiv, and one-byte xchg eax, r32 instead of mov.  For 32bit code: inc/loop instead of test/jnz (I couldn't see a way to use jecxz, and there's no jecxnz).  I posted my final version as a new answer since I think the changes are big enough to justify it.

Python 3, 31
Saved 3 bytes thanks to Sp3000.
g=lambda a,b:b and g(b,a%b)or a

In Python 3.5+: from math import*;gcd

@Sp3000 Nice, I didn't know they had moved it to math.

While you're at it: g=lambda a,b:b and g(b,a%b)or a

@Sp3000 Thanks! I just finished a recursive solution, but that's even better than what I had.

Built-ins for GCD and LCM are disallowed, so the 2nd solution wouldn't be valid.

@mbomb007 I'll remove it. That rule didn't exist when I added that one.

Haskell, 19 bytes
a#0=a
a#b=b#rem a b

Usage example: 45 # 35-> 5.
Euclid, again.
PS: of course there's a built-in gcd, too.

you should explain the trick that reverses the input order to avoid the conditional check

@proudhaskeller: what trick? Everybody uses this algorithm, i.e. stopping on 0 or going on with the modulus.

Nevrmind, everybody is using the trick

This, less golfed, is almost exactly what's in Prelude

MATL, 11 9 bytes
No one seems to have used brute force up to now, so here it is.
ts:\a~f0)

Input is a column array with the two numbers (using ; as separator).
Try it online! or verify all test cases.
Explanation
t     % Take input [a;b] implicitly. Duplicate
s     % Sum. Gives a+b
:     % Array [1,2,...,a+b]
\     % Modulo operation with broadcast. Gives a 2×(a+b) array
a~    % 1×(a+b) array that contains true if the two modulo operations gave 0
f0)   % Index of last true value. Implicitly display

Julia, 21 15 bytes
a\b=a>0?b%a\a:b

Recursive implementation of the Euclidean algorithm. Try it online!
If built-ins weren't forbidden, gcd (3 bytes, built-in GCD) would achieve a better score.
How it works
a\b=             Redefine the binary operator \ as follows:
    a>0?     :       If a > 0:
        b%a\a        Resursively apply \ to b%a and a. Return the result.
              b      Else, return b.

TI-Basic, 27 bytes
Prompt A,B:While B:B→T:BfPart(A/B→B:T→A:End:A

35 byte recursive solution without gcd( or lcm( built-ins (requires 2.53 MP operating system or higher, must be named prgmG):
If Ans(2:Then:{Ans(2),remainder(Ans(1),Ans(2:prgmG:Else:Disp Ans(1:End

You would pass arguments to the recursive variant as {A,B} so for example {1071, 462}:prgmG would yield 21.
TI-Basic, 10 bytes
Prompt A,B:gcd(A,B

Not allowed due to new rule forbidding gcd built-ins

17 byte solution without gcd( built-in
Prompt A,B:abs(AB)/lcm(A,B

Not allowed due to new rule forbidding lcm built-ins

Color me impressed.

You should probably mention that the last one needs to be saved as prgmG.

C, 38 bytes
g(x,y){while(x^=y^=x^=y%=x);return y;}

You need to include the definition of the function in your bytecount.

@Riker sorry for that, I add the definition and update the count

You can save two bytes by naming the function just g instead of gcd.

@Steadybox ok, yes, first time join this community:)

Welcome to the site!

Welcome to PPCG!

C#, 24 bytes
x=(a,b)=>b<1?a:x(b,a%b);

C, 28 bytes
A rather straightforward function implementing Euclid's algorithm. Perhaps one can get shorter using an alternate algorithm.
g(a,b){return b?g(b,a%b):a;}

If one writes a little main wrapper
int main(int argc, char **argv)
{
  printf("gcd(%d, %d) = %d\n", atoi(argv[1]), atoi(argv[2]), g(atoi(argv[1]), atoi(argv[2])));
}

then one can test a few values:

$ ./gcd 6 21
gcd(6, 21) = 3
$ ./gcd 21 6
gcd(21, 6) = 3
$ ./gcd 6 8
gcd(6, 8) = 2
$ ./gcd 1 1
gcd(1, 1) = 1
$ ./gcd 6 16
gcd(6, 16) = 2
$ ./gcd 27 244
gcd(27, 244) = 1

Cubix, 10 12 bytes
?v%uII/;O@

Try it here
This wraps onto the cube as follows:
    ? v
    % u
I I / ; O @ . .
. . . . . . . .
    . .
    . .

Uses the Euclidean Method.
II Two numbers are grabbed from STDIN and put on the stack
/ Flow reflected up
% Mod the Top of Stack.  Remainder left on top of stack
? If TOS 0 then carry on, otherwise turn right
v If not 0 then redirect down and u turn right twice back onto the mod
/ If 0 go around the cube to the reflector
; drop TOS, O output TOS and @ end

I just wrote up a 12-byte Cubix answer, then started scrolling through the answers to see if I needed to handle both 0,x and x,0... then I came across this. Nice one!

Labyrinth, 18 bytes
?}
:
)"%{!
( =
}:{

Terminates with an error, but the error message goes to STDERR.
Try it online!
This doesn't feel quite optimal yet, but I'm not seeing a way to compress the loop below 3x3 at this point.
Explanation
This uses the Euclidean algorithm.
First, there's a linear bit to read input and get into the main loop. The instruction pointer (IP) starts in the top left corner, going east.
?    Read first integer from STDIN and push onto main stack.
}    Move the integer over to the auxiliary stack.
     The IP now hits a dead end so it turns around.
?    Read the second integer.
     The IP hits a corner and follows the bend, so it goes south.
:    Duplicate the second integer.
)    Increment.
     The IP is now at a junction. The top of the stack is guaranteed to be
     positive, so the IP turns left, to go east.
"    No-op.
%    Modulo. Since `n % (n+1) == n`, we end up with the second input on the stack.

We now enter a sort of while-do loop which computes the Euclidean algorithm. The tops of the stacks contain a and b (on top of an implicit infinite amount of zeros, but we won't need those). We'll represent the stacks side to side, growing towards each other:
    Main     Auxiliary
[ ... 0 a  |  b 0 ... ]

The loop terminates once a is zero. A loop iteration works as follows:
=    Swap a and b.           [ ... 0 b  |  a 0 ... ]
{    Pull a from aux.        [ ... 0 b a  |  0 ... ]
:    Duplicate.              [ ... 0 b a a  |  0 ... ]
}    Move a to aux.          [ ... 0 b a  |  a 0 ... ]
()   Increment, decrement, together a no-op.
%    Modulo.                 [ ... 0 (b%a)  |  a 0 ... ]

You can see, we've replaced a and b with b%a and a respectively.
Finally, once b%a is zero, the IP keeps moving east and executes:
{    Pull the non-zero value, i.e. the GCD, over from aux.
!    Print it.
     The IP hits a dead end and turns around.
{    Pull a zero from aux.
%    Attempt modulo. This fails due to division by 0 and the program terminates.

Brachylog, 5 bytes
ḋˢ⊇ᵛ×

Try it online!
Takes input as a list through the input variable and outputs an integer through the output variable. If you use it as a generator, it actually generates all common divisors, it just does so largest first.
         The output is
    ×    the product of the elements of
  ⊇      the maximal sublist
   ᵛ     which is shared by
ḋ        the prime factorization
 ˢ       s of the elements of the input which have them.

Windows Batch, 76 bytes
Recursive function. Call it like GCD a b with file name gcd.
:g
if %2 equ 0 (set f=%1
goto d)
set/a r=%1 %% %2
call :g %2 %r%
:d
echo %f%

MATL, 7 bytes
pG1$Zm/

Try it Online!
Explanation
Since we can't explicitly use the builtin GCD function (Zd in MATL), I have exploited the fact that the least common multiple of a and b times the greatest common denominator of a and b is equal to the product of a and b.
p       % Grab the input implicitly and multiply the two elements
G       % Grab the input again, explicitly this time
1$Zm    % Compute the least-common multiple
/       % Divide the two to get the greatest common denominator

You can save one byte with two separate inputs: *1MZm/

ARM machine code, 12 bytes:
assembly:
gcd: cmp r0, r1
     sublt r0, r0, r1
     bne gcd

Currently can't compile this, but each instruction in ARM takes 4 bytes. Probably it could be golfed down using THUMB-2 mode.

Nice job man anyone who does this in machine code gets serious props from me.

This appears to be an attempt at Euclid's algo using only subtraction, but I don't think it works.  If r0 > r1 then sublt will do nothing (lt predicate is false) and bne will be an infinite loop.  I think you need a swap if not lt, so the same loop can do b-=a or a-=b as needed.  Or a negate if the sub produced carry (aka borrow).

This ARM instruction set guide actually uses a subtraction GCD algorithm as an example for predication.  (pg 25).  They use cmp r0, r1 / subgt r0, r0, r1 / sublt r1, r1, r0 / bne gcd.  That's 16B in ARM instructions, maybe 12 in thumb2 instructions?

On x86, I managed 9 bytes with: sub ecx, eax / jae .no_swap / add ecx,eax / xchg ecx,eax / jne.  So instead of a cmp, I just sub, then undo and swap if the sub should have gone the other way.  I tested this, and it works.  (add won't make jne exit at the wrong time, because it can't produce a zero unless one of the inputs was zero to start with, and we don't support that.  Update: we do need to support either input being zero :/)

For Thumb2, there's an ite instruction: if-then-else.  Should be perfect for cmp / sub one way / sub the other way.

><>, 32 bytes
::{::}@(?\=?v{:}-
.!09}}${{/;n/>

Accepts two values from the stack and apply the euclidian algorithm to produce their GCD.
You can try it here!
For a much better answer in ><>, check out Sok's !

I found a new language today :)

Racket (Scheme), 44 bytes
Euclid implementation in Racket (Scheme)
(define(g a b)(if(= 0 b)a(g b(modulo a b))))

Edit: Didn't see @Numeri 's solution lol. Somehow we got the exact same code independently

Does this work in both?

@NoOneIsHere yeah it works in both

R, 39 33 bytes
Surprised not to see an R answer on here yet. A recursive implementation of the Euclidean algorithm. Saved 2 bytes due to Giuseppe.
g=pryr::f(`if`(o<-x%%y,g(y,o),y))

And here is a vectorized version (35 bytes) which works well for problems like Natural pi calculation.
g=pryr::f(ifelse(o<-x%%y,g(y,o),y))

"if" rather than ifelse for -2 bytes, but you lose the vectorization...

@Giuseppe Thanks, good catch!

Proton, 21 bytes
f=(a,b)=>b?f(b,a%b):a

Try it online!
Shush you, this is totally not a port of the Python answer.

Conditional operator is shorter: f=(x,y)=>y? f(y,x%y):x (yes the space is necessary due to an interpreter bug)

...Right, I need to start thinking Proton, not Python. Thanks!

ReRegex, 23 bytes
Works identically to the Retina answer.
^(_*)\1* \1*$/$1/#input

Try it online!

Add++, 26 bytes
D,g,@@#~,%A$p%+
L,MRBCþgbM

Try it online!
Generates the range \$1, 2, 3, ..., \max(a, b)\$, then filters out elements that don't divide either \$a\$ or \$b\$, Finally, we return the maximum value of the filtered elements.

Forth (gforth), 37 34 bytes
: f dup if tuck mod recurse then ;

Try it online!
Same as the code below, but using recursion instead. Turns out that the combination if then recurse is shorter than begin while repeat by 3 chars, even though the word recurse looks quite bulky.

Previous solution, 37 bytes
: f begin dup while tuck mod repeat ;

Try it online!
Input is two single-cell integers, output is one double-cell integer.
How it works
A "cell" means a space for one item on the stack. A double-cell integer in Forth takes two cells, where the most significant cell is on the top. For this challenge, the GCD of two single-cell integers always fits in a cell, so the upper cell is always 0.
: f ( a b -- d ) \ Define a function f which takes two singles and gives a double
  begin          \ Start a loop
    dup while    \   While b is not zero...
    tuck         \   Copy b under a ( stack: b a b ) and
    mod          \   Calculate a%b  ( stack: b a%b )
                 \   That is, change ( a b ) to ( b a%b )
  repeat ;       \ End loop
                 \ The result is ( gcd 0 ) which is gcd in double-cell

ARMv7 (OakSim), 28 bytes
Hexdump:
0x00010000: 01 00 80 E0 00 10 81 E0 01 00 50 E1 01 00 40 C0 ..........P...@.
0x00010010: 00 10 41 B0 FB FF FF 1A 1E FF 2F E1 00 00 00 00 ..A......./.....

Explanation
Callable function, expects the arguments in r0 and r1, output is in r0.
Expects address of caller stored in lr. This is the standard method of procedure calling as per the ATPCS (ARM Thumb Procedure Call Standard).
gcd:
    add r0, r0, r1        /* Make sure r0 is nonzero */
    add r1, r1, r0        /* Make sure r1 is nonzero */
                          /* We're basically doing the inverse afterwards */

    loop:                 /* main loop: */
        cmp r0, r1        /*     Compare r0 and r1 */
        subgt r0, r0, r1  /*     If r0 >  r1: r0 = r0 - r1 */
        sublt r1, r1, r0  /*     If r0 <  r1: r1 = r1 - r0 */
        bne loop          /*     If r0 != r1: jump back to main loop */

    bx lr                 /* return to caller */

Example call
b caller       /* jump to the caller */
gcd:
               /* omitted to save space */
caller:
    mov r0, 30 /* first operand  = 30 */
    mov r1, 42 /* second operand = 42 */
    mov lr, pc /* link register  = program counter */

    b gcd      /* branch to function */

Javascript, 21 bytes.
I think I'm doing this right, I'm still super new to Javascript.
g=a=>b=>b?g(b)(a%b):a

That won't work. You define g as curried monads, yet use is as a dyadic function.

@Dennis I think I just fixed it? Like I said, super new to JS.

Yes, that works. For the record, g=(a,b)=>b?a:g(b,a%b) is equally short.

@Dennis Ahhhh, that's what I was missing. I forgot the parens around the arguments and it was throwing syntax errors.

Did you intend to put the ternary values the other way around? g=a=>b=>b?g(b)(a%b):a

Doesn't work when a is less than b

@ericw31415 Yes it does: if a<b, then a%b == a, and so the recursive case essentially does g(b)(a), swapping the arguments so that a is now larger. A particularly elegant feature of this algorithm!

@DLosc Wait, this solution doesn't even work for all of the test cases...

@ericw31415 See user81655's comment. When the ternary is switched around, it should work.

@DLosc True. I was originally looking for a GCD function to save work in this answer but this wouldn't work so I came up with my own solution. Seems like I ended up with the same thing as user81665.

05AB1E, 10 bytes
Code:
EàF¹N%O>iN

Try it online!

With built-ins:
¿

Explanation:
¿   # Implicit input, computes the greatest common divisor.
    # Input can be in the form a \n b, which computes gcd(a, b)
    # Input can also be a list in the form [a, b, c, ...], which computes the gcd of
      multiple numbers.

Try it online! or Try with multiple numbers.

Hoon, 20 bytes
|=
{@ @}
d:(egcd +<)

--
Hoon #2, 39 bytes
|=
{a/@ b/@}
?~
b
a
$(a b, b (mod a b))

Oddly, the only implementation in Hoon's stdlib for GCD is the one in use for its RSA crypto, which also returns some other values. I have to wrap it in a function that takes only d from the output.
The other implementation is just the default recursive GCD definition.

GML, 57 bytes
a=argument0
b=argument1
while b{t=b;b=a mod b;a=t}return a

Delphi 7, 148
Well, I think I've found the new worst language for golfing.
unit a;interface function g(a,b:integer):integer;implementation function g(a,b:integer):integer;begin if b=0then g:=a else g:=g(b,a mod b);end;end.

Oh I don't know, parenthetic is pretty poor for golfing

Morgan, you may strip the overhead of a UCSD Pascal unit. The task just asks for a program or function.

Python 3.5, 70 82 73 bytes:
lambda*a:max([i for i in range(1,max(*a)+1)if not sum(g%i for g in[*a])])

The not in this case will make sure the sum all the numbers in *args modulo i are zero.
Also, now this lambda function can take in as many values as you want it to, as long as the amount of values is >=2, unlike the gcd function of the math module. For instance, it can take in the values 2,4,6,8,10 and return the correct GCD of 2.

You're under arrest for multichar variable names. (Or function arguments, but whatever)

Ruby, 23 bytes
g=->a,b{b>0?a:g[b,a%b]}

remember that ruby blocks are called with g[...] or g.call(...), instead of g(...)
partial credits to voidpigeon

Instead of g.call(a,b) you can use g[a,b]. Instead of proc{|a,b|, you can use ->a,b{.

You can also save one byte by using b>0 instead of b<=0 and switching the order of the other operands.

Oracle SQL 11.2, 104 118 bytes
SELECT MAX(:1+:2-LEVEL+1)FROM DUAL WHERE(MOD(:1,:1+:2-LEVEL+1)+MOD(:2,:1+:2-LEVEL+1))*:1*:2=0 CONNECT BY LEVEL<=:1+:2;

Fixed for input of 0

Does not work correctly if one of inputs is zero.

This should save you a few SELECT MAX(LEVEL)FROM DUAL WHERE MOD(:1,LEVEL)+MOD(:2,LEVEL)=0 CONNECT BY LEVEL<=:1+:2;

Javascript, 42 bytes
n=(x,y)=>{for(k=x;x%k+y%k>0;k--);alert(k)}

I could get it down to ~32 with Grond, but whatever

You can save a byte with currying.

Unfortunately, this doesn't work with the new test cases (in particular, 0, 2).

What is currying?

Dennis, 0 / 2 != 2. I say the test cases are wrong... sneaky face

Scheme, 44 bytes
(define(f a b)(if(= b 0)a(f b(modulo a b))))

Scheme is the future of code-golf. :)

><>, 12+3 = 15 bytes
:?!\:}%
;n~/

Expects the input numbers to be present on the stack, so +3 bytes for the -v flag. Try it online!
Another implementation of the Euclidean algorithm.

Maple, 77 75 bytes
`if`(min(a,b)=0,max(a,b),max(`intersect`(op(numtheory:-divisors~({a,b})))))

Usage:
> f:=(a,b)->ifelse(min(a,b)=0,max(a,b),max(`intersect`(op(numtheory:-divisors~({a,b})))));
> f(0,6);
  6
> f(21,12);
  3

This uses a Maple deprecated built-in for computing all of the factors for a and b. The updated built-in is NumberTheory:-Divisors.

Logy, 64 23 bytes
f[X,Y]->Y<1&X|f[Y,X%Y];

Ungolfed:
gcd[X, Y] -> Y < 1 & X | gcd[Y, X%Y];

EDIT: Removed way too many bytes because there is no need for a full program

Racket 38 bytes
  (λ(a b)(if(> b 0)(f b(modulo a b))a))

Ungolfed:
(define f
  (λ (a b)
    (if (<= b 0)
        a
        (f b (modulo a b))
        )))

Testing:
(f 0 2)
(f 6 0)
(f 30 42)
(f 15 14)
(f 7 7)
(f 69 25)
(f 21 12)
(f 169 123)
(f 20 142)
(f 101 202)

Output:
2
6
6
1
7
1
3
1
2
101

Built-ins are disallowed in the challenge specification.

I have corrected the answer.

Java 8, 44 37 bytes
Here is a straight up, non-recursive (because of the lambda) Euclidean algorithm.
(x,y)->{while(y>0)y=x%(x=y);return x}

Update

-7 [16-10-04] Simplified while condition

PHP, 41 51 bytes
similar to my LCM answer:
for($d=1+$a=$argv[1];$argv[2]%--$d||$a%$d;);echo$d;

loop $d down from $argv[1] while $argv[1]/$d or $argv[2]/$d have a remainder.

Perl 5, 51 bytes
49bytes of code + 2 flags (-pa)
$b=pop@F;($_,$b)=(abs$_-$b,$_>$b?$b:$_)while$_-$b

Try it online!
Perl 5, 54 bytes
sub g{my($a,$b)=@_;$a-$b?g(abs($a-$b),$a>$b?$b:$a):$a}

Try it online!

Java, 38 bytes
f=(int a,b)->{return b==0?a:f(b,a%b);}

Welcome to PPCG!

@Ricker thanks :) (I'm assuming that stands for programming puzzles code golf)

tinylisp, 44 bytes
(d G(q((a b)(i(l b a)(G b a)(i a(G(s b a)a)b

Defines a function G that takes two arguments. Try it online!
Explanation
Since mod is not built into tinylisp, we use a subtraction-based algorithm instead.
(Glossary of tinylisp builtins used: d = def, q = quote, i = if, l = less-than, s = subtract)

Define G (d G as a function that takes two arguments (q((a b)
If the second argument is smaller (i(l b a) then recurse with the arguments swapped (G b a)
Otherwise, if the first argument is nonzero (i a then recurse with the new arguments being (larger minus smaller) and (smaller) (G(s b a)a)
Otherwise (the first argument is zero) return the second argument b

Japt, 18 bytes
wV Ä o a@!UuX «VuX

Brute force, tries every integer.
Try it online!

Smalltalk, 29 bytes
[(a:=b\\(b:=a))>0]whileTrue.b

Explanation
a, b                  two integers given as input
b\\(b:=a)             compute (b mod a) and then assign a to b
a:=b\\(b:=a)          assign the remainder just computed to a
[(...)>0]whileTrue    repeat while the reminder a is > 0 (stop otherwise)
b                     return b (the gcd) - dot is a sentence separator

Feel free to expand your answer by including an explanation and a link to an online interpreter. Not everyone here knows Smalltalk. When your answers are short and just code, they show in the "Low Quality Posts" queue and users have to review them. Take a look at answers by other users to see some examples.

@mbomb007 Done. Thanks for the suggestion.

Befunge-93, 22 bytes
&&:#v_\.@
p00:<^:\g00%

Try it online!
Doesn't beat Jo King's answer, but I already spent the time creating this answer before seeing their solution.  C'est la vie.  Uses the same Euclidean Algorithm as most answers.

Japt -h, 5 bytes
Input as an array.
mâ rf

Try it
mâ rf     :Implicit input of integer array
m         :Map
 â        :  Divisors
   r      :Reduce by
    f     :  Filtering, keeping only those elements in the first array that also appear in the second
          :Implicit output of last element

APL (NARS2000), 11 chars, 20 bytes
{×/(π⍺)∩π⍵}

Examples:
      28{×/(π⍺)∩π⍵}144
4
      69{×/(π⍺)∩π⍵}25
1

Why it works:
Function π, when applied monadically, breaks down argument into prime factors. (π⍺)∩π⍵ gives intersection of prime factors of left and right argument. ×/ multiplies prime factors in the intersection, giving the largest divisor common to ⍺ and w. In case ⍺ and w are co-prime then reducing empty intersection would give 1.

Python 3, 58 bytes
lambda a,b:max(n for n in range(1,max(a,b)+1)if a%n+b%n<1)

Try it online!

BQN, 11 bytesSBCS
{(|⊣)⍟}

Run online!
3 bytes shorter and a lot less efficient than the version provided on BQNcrate: {(|⍟(>⟜0)⊣)}
This is a dyadic function with arguments  and .
With left argument  and starting with  as a right argument, call (|⊣)  times, updating the right argument with the return value.  refers to the full function and |⊣ does a recursive call with | ( mod ) as left and  as right argument.
It would be enough to call the inner function just once if  is positive, and not at all if  is 0, but ⍟(×) is just too long.

Rust, 39 bytes
|a,b|(1..=a+b).rev().find(|i|a%i+b%i<1)

Try it online!

Javascript, 48 bytes
$=((r,a)=>{for(;a;){var e=a;a=r%a,r=e}return r})

I'm not quite sure how to test this - when I run it like this it doesn't terminate - how should I run this?

@hyper-neutrino its a function so you need to run it with the parameters being two numbers that you want to find the GCD of. E.g a(2,5)

In my linked example I tried running a(30, 42) and it didn't work. Perhaps the variable name duplication is causing some issues here?

@hyper-neutrino are you console logging it

this is how I am running it. I also tried doing a(30, 42) in my console and it terminated without outputting anything. What version of JavaScript is this? Mine might be out of date.

@hyper-neutrino I have rewritten it and now it should be supported by any version above ES6. It works completely fine for me and I've tried two different computers

Nibbles, 5 bytes (10 nibbles)
`;~$@@$_@%

Verbose
`;   # Recursive function
  ~ $ @   # Call it with the first two command-line arguments (m,n)
  @   # Recurse if n is truthy
  $   # Base case = m
  _ @ %   # Recursive case = gcd(n, m mod n)

Vyxal, 13 bytes
∴ƛ□$%∑¬;¦:Gḟ›

Try it Online!
Thanks to @Fhuvi for pointing out a bug.
Explanation:
∴ƛ□$%∑¬;¦:Gḟ›  # Implicit inputs
∴              # Maximum input
 ƛ     ;       # Map over range(1, ^ + 1):
  □$           #  Push input list and swap
    %∑         #  Sum of each input mod the number
      ¬        #  Equals 0?
        ¦      # Cumulative sums of the list
         :G    # Maximum of that list
           ḟ   # Index of that in the cumulative sums
            ›  # Plus one to account for 0-indexing
               # Implicit output

"You are not allowed to use built-ins that compute either the GCD or the LCM (least common multiple)."

Yeah, I just saw that. Sorry.

Sorry if this adds more work (or bytes), but it seems to not work properly if the first parameter is zero ^^'

@Fhuvi thanks for noticing. That's easily fixed, by adding a ∴ at the start.

jq, 30 bytes
Takes a list of two numbers
until(min<1;[max-min,min])|max

Try it online!

bash, 37
Recursive:
g(){ (($2))&&g $2 $[$1%$2]||echo $1;}

But for making useful function, I prefer assigning variable in order to avoid forks. So I will prefer this for loop:
for((i=$1,l=$2;l;k=l,l=i%l,i=k)){ :;}

Note: both routines use 37 characters!
Test cases
for pair in 0\ 2 6\ 0 30\ 42 15\ 14 7\ 7 69\ 25 21\ 12 169\ 123 20\ 142 101\ 202;do
    printf '%4d %4d => %3d\n' $pair $(g $pair)
done
   0    2 =>   2
   6    0 =>   6
  30   42 =>   6
  15   14 =>   1
   7    7 =>   7
  69   25 =>   1
  21   12 =>   3
 169  123 =>   1
  20  142 =>   2
 101  202 => 101

As a dedicated function:
gcd() {
    if [[ $1 == -v ]];then local -n i=$2;shift 2;else local i;fi
    local l=$2 k
    for((i=$1;l;k=l,l=i%l,i=k)){ :;}
    [[ ${i@A} != i=* ]] || echo "$i"
}

Test cases
for pair in 0:2 6:0 30:42 15:14 7:7 69:25 21:12 169:123 20:142 101:202;do
    IFS=: read -ra vals <<<$pair
    gcd -v res ${vals[@]}
    printf '    %4d %4d => %3d\n' ${vals[@]} $res
done
   0    2 =>   2
   6    0 =>   6
  30   42 =>   6
  15   14 =>   1
   7    7 =>   7
  69   25 =>   1
  21   12 =>   3
 169  123 =>   1
  20  142 =>   2
 101  202 => 101

Desmos, 44 bytes
f(l)=[i0^{mod(l,i).max}fori=[1...l.max]].max

Try it on Desmos!
Input is a list of two integers. It won't work if at least one of the inputs is greater than 10000 because of list length limits, so this is possibly non-competing.

Piet + ascii-piet, 42 bytes (2×21=42 codels)
qbdijbrlkumldqralckkB   jj   s??venvfff bb

Try Piet online!

Very obvious 48 bytes that I noticed at first glance.

42 bytes

Thunno, \$ 19 \log_{256}(96) \approx \$ 15.64 bytes
~e1+I$S0=Ez(DMsAh1+

Attempt This Online!
Thanks to @Fhuvi for pointing out a bug.
Explanation
~e1+I$S0=Ez(DMsAh1+  # Implicit input
~                    # First non-zero input
 e       E           # Map over the range:
  1+                 #  Increment
    I$               #  Mod the input list
      S0=            #  Sum equals 0
          z(         # Cumulative sums
            DM       # Maximum
              sAh    # Index of this in the list
                 1+  # Incremented
                     # Implicit output

Old one which didn't work for 0:
eI$S0=Ez(DMsAh  # Implicit input
e     E         # Map over range:
 I$             #  This number mod the input list
   S0=          #  Sum equals 0
       z(       # Cumulative sums
         DM     # Maximum
           sAh  # Index of this in the list
                # Implicit output

Sorry again, but it seems to not work properly if one of the parameters is zero ^^'

@Fhuvi fixed at the cost of 5 characters

C, 23 bytes
f(x,y){x=x?f(y%x,x):y;}

Essentially Euclid's algorithm in a ternary expression with recursion.

Mathematica, 27 bytes
If[#<1,#2,#0[#2,#~Mod~#2]]&

Not much to see here.

Seriously, 23 bytes
,,;'XQ1╟";(%{}"f3δI£ƒkΣ

This makes use of the Quine command, which is currently the only sane way to do recursion.
Try it online!
Explanation:
,,;'XQ1╟";(%{}"f3δI£ƒkΣ
,,;                      get a and b inputs, duplicate b
   'X                    push "x"
     Q1╟                 push a list containing the program's source code as the singular element
        ";(%{}"f         push the string ";(%{}".format(source_code) (essentially "gcd(b, a % b)")
                3δ       bring the second copy of b to TOS
                  I      if: pop b, recursive call, and "X", and push recursive call if b != 0 else "X"
                   £ƒ    call the string as a function
                     kΣ  sum stack elements (without this, the stack contains the gcd and possibly several 0's)

RETURN, 16 bytes
[$[\¤÷%G][\]?]=G

Try it here.
Recursive operator implementation of Euclid's algorithm. Leaves result on top of stack. Usage:
[$[\¤÷%G][\]?]=G21 12G

Explanation
[            ]=G  Define operator G
 $                Check if b is truthy
  [     ][ ]?     Conditional
   \¤               If so, create pattern [b a b] on stack
     ÷%             Mod top 2 items
       G            Recurse
          \         Otherwise, swap top 2 items

T-SQL, 147 Bytes
SQL Fiddle
MS SQL Server 2014 Schema Setup:
CREATE PROC G @ INT,@B INT,@C INT OUT AS BEGIN IF @<@B EXEC G @B,@,@C OUT ELSE IF @B>0 BEGIN SELECT @=@%@B EXEC G @B,@,@C OUT END ELSE SET @C=@ END

Testing:
Use something like this to generate each set of results:
DECLARE @A INT,@B INT,@EXP INT,@RES INT
  SELECT @A=0,@B=2,@EXP=2
  EXEC G @A,@B,@RES OUT
  SELECT @A A,@B B,@EXP EXPECTED,@RES RESULT

Results:
|  A  |  B  | EXPECTED | RESULT |
|-----|-----|----------|--------|
|   0 |   2 |        2 |      2 |
|   6 |   0 |        6 |      6 |
|  30 |  42 |        6 |      6 |
|  15 |  14 |        1 |      1 |
|   7 |   7 |        7 |      7 |
|  69 |  25 |        1 |      1 |
|  21 |  12 |        3 |      3 |
|  20 | 142 |        2 |      2 |
| 101 | 202 |      101 |    101 |

Oracle SQL 11.2, 108 Bytes
CREATE PROCEDURE G(A INT,B INT,C OUT INT)AS BEGIN IF A>0 THEN G(LEAST(A,B),ABS(A-B),C);ELSE C:=B;END IF;END;

Testing:
CREATE FUNCTION testHelper(A INT,B INT) RETURN INT
AS
  C INT;
BEGIN
  G(A,B,C);
  RETURN C;
END;
/

WITH tests( A, B, Expected ) AS (
  SELECT   0,  2,  2 FROM DUAL UNION ALL
  SELECT   6,  0,  6 FROM DUAL UNION ALL
  SELECT  30, 42,  6 FROM DUAL UNION ALL
  SELECT  15, 14,  1 FROM DUAL UNION ALL
  SELECT   7,  7,  7 FROM DUAL UNION ALL
  SELECT  69, 25,  1 FROM DUAL UNION ALL
  SELECT  21, 12,  3 FROM DUAL UNION ALL
  SELECT 169,123,  1 FROM DUAL UNION ALL
  SELECT  20,142,  2 FROM DUAL UNION ALL
  SELECT 101,202,101 FROM DUAL
)
SELECT t.*,testHelper(A,B) AS "RESULT"
FROM   tests t;

Output:
         A          B   EXPECTED     RESULT
---------- ---------- ---------- ----------
         0          2          2          2
         6          0          6          6
        30         42          6          6
        15         14          1          1
         7          7          7          7
        69         25          1          1
        21         12          3          3
       169        123          1          1
        20        142          2          2
       101        202        101        101

J, 15 14 bytes
[`(|$:[)@.(]*)

Uses Euclid's algorithm.
Usage
   f =: [`(|$:[)@.(]*)
   30 f 42
6
   42 f 30
6
   169 f 123
1

Explanation
[`(|$:[)@.(]*)  Input: a, b
           ]*   Get sign(b)
                If sign(n) = 0
[                 Return a
                Else
   |              Get b mod a
      [           Get a
    $:            Call recursively on (b mod a, a)

Java 7, 42 bytes
int c(int a,int b){return b>0?c(b,a%b):a;}

Ungolfed & test cases:
Try it here.
class M{
  static int c(int a, int b){
    return b > 0
            ? c(b, a%b)
            : a;
  }

  public static void main(String[] a){
    System.out.println(c(0, 2));
    System.out.println(c(6, 0));
    System.out.println(c(30, 42));
    System.out.println(c(15, 14));
    System.out.println(c(7, 7));
    System.out.println(c(69, 25));
    System.out.println(c(21, 12));
    System.out.println(c(169, 123));
    System.out.println(c(20, 142));
    System.out.println(c(101, 202));
  }
}

Output:
2
6
6
1
7
1
3
1
2
101

Befunge-93, 21 bytes
&&:v_.@
00:_^#:%g00\p

Try it Online
Yet another Euclidean algorithm

MACHINE LANGUAGE(X86, 32 bit), 19 bytes
0000079C  8B442404          mov eax,[esp+0x4]
000007A0  8B4C2408          mov ecx,[esp+0x8]
000007A4  E308              jecxz 0x7ae
000007A6  31D2              xor edx,edx
000007A8  F7F1              div ecx
000007AA  92                xchg eax,edx
000007AB  91                xchg eax,ecx
000007AC  EBF6              jmp short 0x7a4
000007AE  C3                ret
000007AF

7AFh-79Ch=13h=19d (see other x86 solution too).Below assembly with the function,
but for me gcd(a,b) if a or b is 0 has to return -1 error...
; nasmw -fobj  this.asm
; bcc32 -v  file.c this.obj
section _DATA use32 public class=DATA
global _gcda
section _TEXT use32 public class=CODE

_gcda:
      mov     eax,  dword[esp+  4]
      mov     ecx,  dword[esp+  8]
.1:   JECXZ   .z
      xor     edx,  edx
      div     ecx
      xchg    eax,  edx
      xchg    eax,  ecx
      jmp     short  .1
.z:
      ret

this is the C function for test, that call the gcda() function:
#include <stdio.h>
unsigned v0[]={30,15,7,69,21,169, 20,101,0,6,1,0};
unsigned v1[]={42,14,7,25,12,123,142,202,2,0,2,0};
unsigned gcda(unsigned,unsigned);

main(void)
{int  i;
 for(i=0;v0[i]||v1[i];++i)
    printf("gcd(%u,%u)=%u\n",v0[i],v1[i],gcda(v0[i],v1[i]));
 return 0;
}

results:
gcd(30,42)=6
gcd(15,14)=1
gcd(7,7)=7
gcd(69,25)=1
gcd(21,12)=3
gcd(169,123)=1
gcd(20,142)=2
gcd(101,202)=101
gcd(0,2)=2
gcd(6,0)=6
gcd(1,2)=1

The loop is the same as the unsigned 32-bit version described in my answer, except without the inc/loopoptimization (3 bytes in 32-bit mode vs. 2+2=4 for JECXZ/JMP), so it's safer with a 0 input. Plus loading args from the stack, instead of using a better calling convention like GCC'sattribute((regparm(3)))` (EAX, EDX, ECX in that order).  Even for stack args, you could do 3x pop, then 3x push to put things back (including the return address), leaving values in regs in 6 bytes instead of 8 for 2x 4 (mov_opcode + modrm + sib + disp8)

Japt, 9 bytes
V?ßVU%V:U

Run it online
8 bytes if we can reverse the order of the input:
?ßV%UU:V

Run it online

Ink, 29 bytes
=i(a,b)
{b:->i(b,a%b)}{a}->->

Try it online!

APL(NARS), 13 chars, 26 bytes
{⍵<1:⍺⋄⍵∇⍵∣⍺}

test:
  g←{⍵<1:⍺⋄⍵∇⍵∣⍺}
  30 g 42
6
  42 g 30
6
  15 g 14
1
  7 g 7
7
  69 g 25
1
  0 g 2
2
  6 g 0
6

AWK, 39 bytes
{for(x=$1>$2?$1:$2;$1%x||$2%x;)--x}$0=x

Try it online!
Does require that 1 of the inputs be positive. Nothing fancy, but I don't see another AWK solution.

Perl 6, 28 bytes
my&f={$^b??f($b,$^a%$b)!!$a}

Forth (gforth), 52 bytes
: f begin 2dup max -rot min tuck mod ?dup 0= until ;

Try it online!
Uses Euclidean Algorithm [repeatedly call larger % smaller until result is 0]
Code Explanation
: f               \ start a new word definition
  begin           \ start and indefinite loop
    2dup          \ duplicate arguments
    max -rot min  \ reorder arguments so the smaller is on top
    tuck          \ make a copy of the smaller argument and move it behind the larger
    mod ?dup 0=   \ get the modulo of the two arguments, then duplicate and check if it is 0
  until           \ end the loop if it is
;                 \ end the word definition

Ral, 45 37 bytes
,:,+0=0*/-:1+1:+1+:+:1=?0*+0*/:0=1*?.

Try it online! (inputs on separate lines)
Commented:
,:,                  Input a and b
+0=                  Add a to b
                   Loop:
0*/-                 Subtract b from a
:1+1:+1+:+:1=?       Continue if a >= 0
0*+                  Add b to a
0*/:0=               Swap a and b
1*?                  Continue if b > 0
.                    Print a

Zsh, 29 bytes
(($1))&&$0 $[$2%$1] $1||<<<$2

Try it online!

Thunno 2, 10 bytes
GıḊp;ṡDGȮ⁺

Attempt This Online!
Port of my Vyxal answer.
Explanation
GıḊp;ṡDGȮ⁺  # Implicit input
Gı  ;       # Map over (the one-range of) the higher number:
  Ḋ         #  Is each input divisible by this number?
   p        #  Are both true?
     ṡ      # Cumulative sums of this list
      DG    # Without popping, push the maximum
        Ȯ⁺  # 1-based index of the maximum
            # Implicit output

Vyxal G, 37 bitsv1, 4.625 bytes
vKƒ↔∨

Try it Online!
Why use ranges and sums when a more logical approach is shorter :p
Takes input as a list of numbers.
Explained
vKƒ↔∨
vK      # Get the divisors of each number
  ƒ↔    # reduce by set intersection. This will either give a list of shared divisors or an empty list. You only get an empty list if there is a 0 in the input.
     ∨  # logical or with the input, getting the first truthy value. If there's a 0 in the input, this returns the input list
# The G flag gets the biggest of either the shared factors or the input list if there's a 0.

Nekomata, 5 bytes
ṀRᶠ¦Ṁ

Attempt This Online!
Takes a list of two numbers as input.
ṀRᶠ¦Ṁ
Ṁ       Maximum of the input
 R      Range from 1 to that
  ᶠ     Filter by the following function:
   ¦      Check that it divides both numbers in the input
    Ṁ   Maximum of the resulting list

Nekomata, 6 bytes
ʷ{$ᵉ%Z

Attempt This Online!
Using the Euclidean algorithm.
ʷ{$ᵉ%Z
ʷ{      Apply the following function repeatedly until it fails:
          Let the stack be a, b
  $       a, b -> b, a
   ᵉ%     b, a -> b, a % b
     Z    Check that b is not zero

Pyth, 2 bytes
iE

Try it here!
Input as integer on two separate lines. Just uses a builtin.

Haha, I like it.

If you change the input format, iF also works. In addition, I think M?HgH%GHG is the shortest no-builtin way of doing this.

I think the question disallows using a GCD builtin.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Beat Pure Regular Expressions at Validating ISO 8601 Dates
In ValiDate ISO 8601 by RX, the challenge was to use only standard regular expressions to validate standard date formats and values (the former is a common job for RX, the latter was unusual). The winning answer used 778 bytes. This challenge is to beat that using any language of your choosing, but without special date functions or classes.
Challenge
Find the shortest code that

validates every possible date in the Proleptic Gregorian calendar (which also applies to all dates before its first adoption in 1582),
does not match any invalid date and
does not use any predefined functions, methods, classes, modules or similar for handling dates (and times), i.e. relies on string and numeric operations.

Output
Output is truthy or falsey.
It’s not necessary to output or convert the date.
Input
Input is a single string in any of 3 expanded ISO 8601 date formats – no times.
The first two are ±YYYY-MM-DD (year, month, day) and ±YYYY-DDD (year, day). Both need special-casing for the leap day. They are naively matched separately by these extended RXs:
(?<year>[+-]?\d{4,})-(?<month>\d\d)-(?<day>\d\d)
(?<year>[+-]?\d{4,})-(?<doy>\d{3})

The third input format is ±YYYY-wWW-D (year, week, day). It is the complicated one because of the complex leap week pattern.
(?<year>[+-]?\d{4,})-W(?<week>\d\d)-(?<dow>\d)

Conditions
A leap year in the Proleptic Gregorian calendar contains the leap day …-02-29 and thus it is 366 days long, hence …-366 exists. This happens in any year whose (possibly negative) ordinal number is divisible by 4, but not by 100 unless it’s also divisible by 400.
Year zero exists in this calendar and it is a leap year.
A long year in the ISO week calendar contains a 53rd week …-W53-…, which one could term a “leap week”. This happens in all years where 1 January is a Thursday and additionally in all leap years where it’s a Wednesday. 0001-01-01 and 2001-01-01 are Mondays. It turns out to occur every 5 or 6 years usually, in a seemingly irregular pattern.
A year has at least 4 digits. Years with more than 10 digits do not have to be supported, because that’s close enough to the age of the universe (ca. 14 billion years). The leading plus sign is optional, although the actual standard suggests it should be required for years with more than 4 digits.
Partial or truncated dates, i.e. with less than day-precision, must not be accepted.
Separating hyphens - are required in all cases.
(These preconditions make it possible for leading + to be always optional.)
Rules
This is code-golf. The shortest code in bytes wins.
Earlier answer wins a tie.
Test cases
Valid tests
2015-08-10
2015-10-08
12015-08-10
-2015-08-10
+2015-08-10
0015-08-10
1582-10-10
2015-02-28
2016-02-29
2000-02-29
0000-02-29
-2000-02-29
-2016-02-29
+2016-02-29
200000-02-29
-200000-02-29
+200000-02-29
2016-366
2000-366
0000-366
-2000-366
-2016-366
+2016-366
2015-081
2015-W33-1
2015-W53-7
+2015-W53-7
+2015-W33-1
-2015-W33-1
 2015-08-10

The last one is optionally valid, i.e. leading and trailing spaces in input strings may be trimmed.
Invalid formats
-0000-08-10     # that's an arbitrary decision
15-08-10        # year is at least 4 digits long
2015-8-10       # month (and day) is exactly two digits long, i.e. leading zero is required
015-08-10       # year is at least 4 digits long
20150810        # though a valid ISO format, we require separators; could also be interpreted as a 8-digit year
2015 08 10      # separator must be hyphen-minus
2015.08.10      # separator must be hyphen-minus
2015–08–10      # separator must be hyphen-minus
2015-0810
201508-10       # could be October in the year 201508
2015 - 08 - 10  # no internal spaces allowed
2015-w33-1      # letter ‘W’ must be uppercase
2015W33-1       # it would be unambiguous to omit the separator in front of a letter, but not in the standard
2015W331        # though a valid ISO format we require separators
2015-W331
2015-W33        # a valid ISO date, but we require day-precision
2015W33         # though a valid ISO format we require separators and day-precision
2015-08         # a valid ISO format, but we require day-precision
201508          # a valid but ambiguous ISO format
2015            # a valid ISO format, but we require day-precision

Invalid dates
2015-00-10  # month range is 1–12
2015-13-10  # month range is 1–12
2015-08-00  # day range is 1–28 through 31
2015-08-32  # max. day range is 1–31
2015-04-31  # day range for April is 1–30
2015-02-30  # day range for February is 1–28 or 29
2015-02-29  # day range for common February is 1–28
2100-02-29  # most century years are non-leap
-2100-02-29 # most century years are non-leap
2015-000    # day range is 1–365 or 366
2015-366    # day range is 1–365 in common years
2016-367    # day range is 1–366 in leap years
2100-366    # most century years are non-leap
-2100-366   # most century years are non-leap
2015-W00-1  # week range is 1–52 or 53
2015-W54-1  # week range is 1–53 in long years
2016-W53-1  # week range is 1–52 in short years
2015-W33-0  # day range is 1–7
2015-W33-8  # day range is 1–7

off topic, but maybe useful - Stack Overflow: http://stackoverflow.com/questions/28020805/regex-validate-correct-iso8601-date-string-with-time   (if I shouldn't post that, tell me)

What if the programmer is a YEC (Young-Earth Creationist)?

About -0000-08-10 what is exaclty the arbitrary decision? Not allowing the year as negative 0?

@edc65 Yes, +0000-08-10 and 0000-08-10 should be used instead. Note, though, that the accepted answer in the regular expression variant of this challenge fails this particular test case, so it’s not really a failing condition (i.e. a should, not a must).

@KennyLau Then the programmer is wrong.

JavaScript (ES6), 236
236 bytes allowing negative 0 year (-0000). Returns true or false
s=>!!([,y,w,d]=s.match(/^([+-]?\d{4,})(-W?\d\d)?(-\d{1,3})$/)||[],n=y%100==0&y%400!=0|y%4!=0,l=((l=y-1)+8-~(l/4)+~(l/100)-~(l/400))%7,l=l==5|l==4&!n,+d&&(-w?d>`0${2+n}0101001010`[~w]-32:w?(w=w.slice(2),w>0&w<(53+l)&d>-8):d[3]&&d>n-367))

Adding the check for negative 0 cut 2 bytes but adds 13. Note that in javascript the numeric value -0 exists, and it is special cased to be equal to 0, but 1/-0 is -Infinity. This versione returns 0 or 1
s=>([,y,w,d]=s.match(/^([+-]?\d{4,})(-W?\d\d)?(-\d{1,3})$/)||[],n=y%100==0&y%400!=0|y%4!=0,l=((l=y-1)+8-~(l/4)+~(l/100)-~(l/400))%7,l=l==5|l==4&!n,+d&&(-w?d>`0${2+n}0101001010`[~w]-32:w?(w=w.slice(2),w>0&w<(53+l)&d>-8):d[3]&&d>n-367))&!(!+y&1/y<0)

Test

Check=
  s=>!! // to obtain a true/false
  (
    // parse year in y, middle part in w, day in d
    // day will be negative with 1 or 3 numeric digits and could be 0
    // week will be '-W' + 2 digits
    // month will be negative with2 digits and could be 0
    // if the date is in format yyyy-ddd, then w is empty
    [,y,w,d] = s.match(/^([+-]?\d{4,})(-W?\d\d)?(-\d{1,3})$/) || [],
    n = y%100==0 & y%400!=0 | y%4!=0, // n: not leap year
    l = ((l=y-1) + 8 -~(l/4) +~(l/100) -~(l/400)) % 7,
    l = l==5| l==4 & !n, // l: long year (see http://mathforum.org/library/drmath/view/55837.html)
    +d && ( // if d is not empty and not 0
     -w // if w is numeric and not 0, then it's the month (negative)
     ? d > `0${2+n}0101001010`[~w] - 32 // check month length (for leap year too)
      : w // if w is not empty, then it's the week ('-Wnn')
        ? ( w = w.slice(2), w > 0 & w < (53+l) & d >- 8) // check long year too
        : d[3] && d > n-367 // else d is the prog day, has to be 3 digits and < 367 o 366
    )
  )

console.log=x=>O.textContent += x +'\n'

OK=['1900-01-01','2015-08-10','2015-10-08','12015-08-10','-2015-08-10','+2015-08-10'
,'0015-08-10','1582-10-10','2015-02-28','2016-02-29','2000-02-29'
,'0000-02-29','-2000-02-29','-2016-02-29','+2016-02-29','200000-02-29'
,'-200000-02-29','+200000-02-29','2016-366','2000-366','0000-366'
,'-2000-366','-2016-366','+2016-366','2015-081','2015-W33-1'
,'2015-W53-7','+2015-W53-7','+2015-W33-1','-2015-W33-1','2015-08-10']

KO=['-0000-08-10','15-08-10','2015-8-10','015-08-10','20150810','2015 08 10'
,'2015.08.10','2015–08–10','2015-0810','201508-10','2015 - 08 - 10','2015-w33-1'
,'2015W33-1','2015W331','2015-W331','2015-W33','2015W33','2015-08','201508'
,'2015','2015-00-10','2015-13-10','2015-08-00','2015-08-32','2015-04-31'
,'2015-02-30','2015-02-29','2100-02-29','-2100-02-29','2015-000'
,'2015-366','2016-367','2100-366','-2100-366','2015-W00-1'
,'2015-W54-1','2016-W53-1','2015-W33-0','2015-W33-8']

console.log('Valid')
OK.forEach(x=>console.log(Check(x)+' '+x))
console.log('Not valid')
KO.forEach(x=>console.log(Check(x)+' '+x))

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/