[Question]
  [
# Where am I now?
Given a string `d`, containing only the letters `NSWE`, determine the coordinates I've traveled (from left to right, consuming greedily) and the final coordinate where I reside.
The rules for reading coordinates from left-to-right:
* ***If the next character is `N` or `S`***:
	+ **If the character after the `N` or `S` is another `N` or `S`**:
		- Consume only the first `N` or `S`.
		- Output `[0,1]` for `N`
		- Output `[0,-1]` for `S`
	+ **If the character after the `N` or `S` is `W` or `E`**:
		- Consume both the `N` or `S` and the `W` or `E`.
		- Output `[1,1]` or `[-1,1]` for `NE` and `NW`, respectively.
		- Output `[1,-1]` or `[-1,-1]` for `SE` and `SW`, respectively.
* ***If the character is an `E` or `W` not preceded by an `S` or `N`***:
	+ Consume the `E` or `W`.
	+ Output `[1,0]` for `E`.
	+ Output `[-1,0]` for `W`.
---
# Worked Example
***NSWE***
```
[0,1]   (North      N)
[-1,-1] (South-west SW)
[1,0]   (East       E)
[0,0]   (N+SW+E = Didn't actually move)
```
Note this can be in any format, here are other examples of valid output:
```
[[0,1],[-1,-1],[1,0],[0,0]]
[[[0,1],[-1,-1],[1,0]],[0,0]]
"0,1\n0,-1\n-1,0\n1,0\n0,0"
```
Etc...
---
# More Examples
***SWSENNESWNE***
```
[-1,-1]
[1,-1]
[0,1]
[1,1]
[-1,-1]
[1,1]
[1,0]
```
***NNEESESSWWNW***
```
[0,1]
[1,1]
[1,0]
[1,-1]
[0,-1]
[-1,-1]
[-1,0]
[-1,1]
[0,0]
```
**NENENEE**
```
[1,1]
[1,1]
[1,1]
[1,0]
[4,3]
```
**NEN**
```
[1,1]
[0,1]
[1,2]
```
**EEE**
```
[1,0]
[1,0]
[1,0]
[3,0]
```
---
# Rules
* You may output in any convenient format that doesn't violate loopholes.
* You must consume greedily, `NWE` is never `N,W,E`, it is always `NW,E`.
	+ This applies to: `SW*`, `SE*`, `NW*`, `NE*`.
	+ You are consuming left to right, greedily.
* The is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), lowest byte-count wins.
  
[Answer]
# [Python 2](https://docs.python.org/2/), 116 bytes
```
import re
a=[(int(s,35)%5-3,('N'in s)-('S'in s))for s in re.findall('[NS][EW]?|.',input())]
print a,map(sum,zip(*a))
```
[Try it online!](https://tio.run/##JcyxCsMgFEDRPV/hUt57xWRoyFg6ubo4OIiD0IQK0YiaoaX/boXe6Uw3vevriLfWfEhHriyvg7sb9LFi4fNCl2WcOYIEH1mhEUH9RduRWWHdeZ02H59u3xGMVNYIbR/fCbiP6axIZIeU@485HlzCcgb@8Qmvjqg1kFIIJZTSWmrRUz34AQ "Python 2 – Try It Online")
## With output as `[(3+4j), 1, -1j, …]`, 91 bytes
```
lambda x:[sum(1j**(ord(c)%8%5)for c in s)for s in[x]+re.findall('[NS][EW]?|.',x)]
import re
```
[Try it online!](https://tio.run/##Hca9CgIhAADgvadwOdQrDgqCCKLJ1cXBwRzsPMnDPzwDg97dpG/60qe8Yjg1c3s0p/xTK1CvYnt7dFzHEcWs0YyHy3DGJmYwAxvA9u/WK6rc52UyNmjlHIKCMikIl/fvBA8Vy531KeYC8tJStqEAgyClhDDCGOeUk451BOL2Aw "Python 2 – Try It Online")
This lambda returns a list of [Gaussian integers](https://en.wikipedia.org/wiki/Gaussian_integer): the first is the final coordinate, and all others are the steps required to get there.
[Answer]
# [Attache](https://github.com/ConorOBrien-Foxx/attache), 80 bytes
```
V#Sum##{Chop[1-ToBase[22260446188,3],2][Sum@Ords=>MatchAll[_,/"[NS][WE]|."]%11]}
```
[Try it online!](https://tio.run/##dY9PSwMxFMTv/RQhq3tx/bOxlFJYiZb0IDRKU8zhETRks25h2w2bJx7Uz77GevDkbWb4vceMRbSu9WOzqManTL3ts@xj2fYByvNtf2ejB8bY7Go6nZXzeXFtCmYgUfxhqGN1s7bo2tuug@fikoJUBrQwnxfUnJal@Rql93WEkxDcq5lM0JFFRYBKpQUtCFVaCSmF0vJokxRKKKW11DThj8PugECBbOw7QR8xEpPyY7xNdpnKRWgKgs78wat@2FtEX/9/0jX5yxm/73eHvGv42gbY@DAY/jM7Z3zVWeS/b8dv "Attache – Try It Online")
This is an anonymous function which takes one string argument.
## Explanation
The first task is to implement the parsing phase of this question. I found it shortest to use a simple Regex to parse the input (`_`):
```
MatchAll[_,/"[NS][WE]|."]
```
This matches all occurrences of the regex `[NS][WE]|.`, as seen in many other answers. This greedily yields the requested directions.
Now, we're going to apply a hash function to each direciton. We take the codepoints of each direction and sum them. This gives the following mapping:
```
Direction       Ord-sum
E               69
N               78
S               83
W               87
NE              147
SE              152
NW              165
SW              170
```
We shall try to map these values to a smaller domain; modulo is useful for this, and we can [demonstrate that the smallest modulo which results in unique values for all given inputs](https://tio.run/##TYzLCsMgFET3fsVsCi2I9JWYLvySkIUBW6SxNVFLH@bbrQYKXdwDd2Y4U@hfKQ3aeaEecsBFeUcCNRAoIXP6rViw/r5eXiOfG3wQTSRA@I2MtCVUEQorGMy57Cclr2izqoM@I7Bw0@Oig/hzk5lY5FFKbX2i4A1Fc8jHKXbHgmqfUVcZfNt9AQ) is 11. Sorting by remainders, this gives us the following table:
```
Direction       Ord-sum         % 11
NW              165             0
N               78              1
E               69              3
NE              147             4
SW              170             5
S               83              6
SE              152             9
W               87              10
```
Now, we have an input correspondence, as encoding by `Sum@Ords=>[...]%11`. Next, we have to transform these remainders into points. We shall try to derive another mapping, which means inserting "sparse-filling values" to hashes which do not correspond to directions shall be useful:
```
Direction       Hash        Coordinates
NW              0           [-1, 1]
N               1           [0, 1]
--             (2)          [0, 0]
E               3           [1, 0]
NE              4           [1, 1]
SW              5           [-1, -1]
S               6           [0, -1]
--             (7)          [0, 0]
--             (8)          [0, 0]
SE              9           [1, -1]
W               10          [-1, 0]
```
We currently have a series of points, which can gives a list indexable by the hash:
```
[-1, 1] [0, 1] [0, 0] [1, 0] [1, 1] [-1, -1] [0, -1] [0, 0] [0, 0] [1, -1] [-1, 0]
```
Now, we shall compress this, seeing as how its only composed of `-1`s, `0`s, and `1`s. Since the list represents pairs, we can flatten the list without losing data. Then, if we take each number `x` and calculate `1-x`, we get the following list:
```
2 0 1 0 1 1 0 1 0 0 2 2 1 2 1 1 1 1 0 2 2 1
```
We can convert this into a base 3 number:
```
20101101002212111102213
```
Converting to base 10:
```
20101101002212111102213 ≡ 2226044618810
```
To summarize, we've taken our points, un-paired them, took each element subtracted from `1`, and converted from base `3`, giving us `22260446188`. We can decompress as such:
1. Convert to base 3: `ToBase[22260446188,3]`
2. Take each number subtracted from one (self-inverse): `1-ToBase[22260446188,3]`
3. Re-pair the list: `Chop[1-ToBase[22260446188,3],2]`
This gives us our original set of pairs. Then, we can perform the aforementioned indexing like this:
```
(chopped value)[hashes]
```
Since, in Attache, indexing by an array returns all elements corresponding to those indices. (So, `[1,2,3,4][ [0,0,-1,1] ] = [1,1,4,2]`.) Now, we have the directions of the path that the OP walked. What's left is to calculate the sum.
So we capture this result in a lambda `{...}` and put it as the first function in a function composition (`a##b`), with the second being `V#Sum`. This is a fork, which, given input `x`, expands to be:
```
V[x, Sum[x]]
```
`Sum`, when given an 2D array, happens to sum every column in the array (as a result of vectorized summation). So, this pairs the directions with the final destination, and we have our final result.
[Answer]
# JavaScript (ES6), 102 bytes
Returns a string.
```
s=>s.replace(/[NS][EW]|./g,s=>(D=d=>!!s.match(d),x+=h=D`E`-D`W`,y+=v=D`N`-D`S`,[h,v]+`
`),x=y=0)+[x,y]
```
[Try it online!](https://tio.run/##dcqxDoMgFEDRvX/hJAbU/sBzkpXlDQyUBKKobawYMUaT/rulQ5cmHW/OfdjNhma5z2s@@dadHZwBqlAsbh5t40ipBGrFpX4VZc8ikRpaqJIkFE@7NgNpM7ZTGKA23OS1kYYdFLaY4pNomBrYpqm5mDjCAdeMqp0d@mz8FPzoitH3pCOpQMnTjKa3Kc0uP4YSuRAcpfi7RObIEaUU8vucbw "JavaScript (Node.js) – Try It Online")
[Answer]
# [MATL](https://github.com/lmendo/MATL), 45 bytes
```
'NS' 'WE'Z*Z{2MhX{h'eklihfmj'X{YX9\3_2&YAqts
```
[Try it online!](https://tio.run/##y00syfn/X90vWF1BPdxVPUorqtrINyOiOkM9NTsnMyMtN0s9ojoywjLGON5ILdKxsCSiGKwcqBYA) Or [verify all test cases](https://tio.run/##y00syfmf8F/dL1hdQT3cVT1KK6rayDcjojpDPTU7JzMjLTdLPaI6MsIyxjjeSC3SsbAkovi/QXKESwhID1ADl3pweLCrn59rcLgfiAdkuQa7BgeHh/uFqwMA).
### Explanation (with example)
Consider input `'NSWE'` as an example.
```
'NS' 'WE'  % Push these two strings
           % STACK: 'NS', 'WE'
Z*         % Cartesian product. Gives a 4×2 char matrix
           % STACK: ['NW'; 'NE'; 'SW'; 'SE']
Z{         % Cell array of rows (strings)
           % STACK: {'NW', 'NE', 'SW', 'SE'}
2M         % Push again the inputs of the second-last function call
           % STACK: {'NW', 'NE', 'SW', 'SE'}, 'NS', 'WE'
h          % Concatenate horizontally
           % STACK: {'NW', 'NE', 'SW', 'SE'}, 'NSWE'
X{         % Cell array of individual elements (chars)
           % STACK: {'NW', 'NE', 'SW', 'SE'}, {'N', 'S', 'W', 'E'}
h          % Concatenate horizontally
           % STACK: {'NW', 'NE', 'SW', 'SE', 'N', 'S', 'W', 'E'}
'eklihfmj' % Push this string
           % STACK: {'NW', 'NE', 'SW', 'SE', 'N', 'S', 'W', 'E'}, 'eklihfmj'
X{         % Cell array of individual elements (chars)
           % STACK: {'NW','NE','SW','SE','N','S','W','E'},{'e','k','l','i','h','f','m','j'}
YX         % Implicit input. Regexp replace: replaces 'NW' by 'e', then 'NE' by 'k', etc.
           % Note that the two-letter combinations are replaced first, which implements
           % the greediness; and the target letters do not appear in the source, which
           % avoids unwanted interactions between replacements
           % STACK: 'hlj'
9\         % Modulo 9 (of codepoints), element-wise
           % STACK: [5, 0, 7]
3_2&YA     % Convert to base 3 with 2 digits. Gives a 2-column matrix
           % STACK: [1, 2; 0, 0; 2, 1]
q          % Subtract 1, element-wise
           % STACK: [0, -1; -1, -1; 1, 0]
tXs        % Duplicate. Sum of each column
           % STACK: [0, -1; -1, -1; 1, 0], [0, 0]
           % Implicit display
```
[Answer]
# [Java (JDK)](http://jdk.java.net/), 167 bytes
```
s->{var r="";int i=0,l=s.length,c,x=0,y=0,Y,X;for(;i<l;x+=X=c>1||i<l&&(c=~-s[i]/6%4)>1&&++i>0?c*2-5:0,r+=X+","+Y+" ")y+=Y=(c=~-s[i++]/6%4)<2?1-c*2:0;return r+x+","+y;}
```
[Try it online!](https://tio.run/##fVFbb4IwFH73V5w0mYEVmJptD9RiloW9jZc@oDE@dHirQyBtMRLn/ror4O7Z2pw057s032k3fMfdzfz5JLZFLjVsTO@VWqTeJen8wpZllmiRZzWZpFwpeOQig0MHoCifUpGA0lybY5eLOWwNZzEtRbaazoDLlbIbKcDD@Z5hsuZyOnNaUQBLoCflBocdlyApQkRkGgTtOSlVXrrIVnrtJM7eAJWpiTMmy1xaRAxTssd0TJOg//Jium7XSuirq6ZidnV7cW0H/W4XYxH0RsnlwL3xe440cowchCcYAbIrTCf03YNx6xoORn3XGPwekQtdygwk3jemihxPpJnkYzy9UFoBPQ9YLxSxOETOZ89iFkZRyOLoG2ygkIWMxXEUf8PDeoc/oK9t@IU9tnnq92gzNYn8Npf9EYtVSi@2Xl5qrzAqnWZWrcDIRzb5W7P0eFGkVaP1dH5vvu1OSl5Ztv2f7cwdO3UdT28 "Java (JDK) – Try It Online")
## Explanations
Thanks to `c=~-s[i]/6%4`, the following mapping is done:
```
'N' -> ascii: 78 -> -1 = 77 -> /6 = 12 -> %4 = 0
'S' -> ascii: 83 -> -1 = 83 -> /6 = 13 -> %4 = 1
'W' -> ascii: 87 -> -1 = 86 -> /6 = 14 -> %4 = 2
'E' -> ascii: 69 -> -1 = 68 -> /6 = 11 -> %4 = 3
```
* `NS` is checked with `c<2` and mapped to `+1`/`-1` using `1-c*2`;
* `EW` is checked with `c>1` and mapped to `+1`/`-1` using `c*2-5`.
## Credits
* at the very least 9 bytes saved thanks to [Kevin Cruijssen](https://codegolf.stackexchange.com/users/52210/kevin-cruijssen).
* -4 bytes thanks to [ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat)
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 93 bytes
```
.+
$&¶$&
\G[NS]?[EW]?
$&¶
G`.
W
J
%O`.
+`EJ|NS
m`^((J)?[EJ]*)((S)?[NS]*)
$#2$*-$.1,$#4$*-$.3
```
[Try it online!](https://tio.run/##K0otycxL/P9fT5tLRe3QNhU1rhj3aL/gWPto1/BYe7AYl3uCHlc4lxeXqj@QoZ3g6lXjF8zFlZsQp6HhpQlU6BWrpamhEQxkAjVqaXKpKBupaOmq6BnqqCibgFnG///7BbuGAwA "Retina 0.8.2 – Try It Online") Explanation:
```
.+
$&¶$&
```
Duplicate the input.
```
\G[NS]?[EW]?
$&¶
```
Split the first copy up into directions.
```
G`.
```
Remove extraneous blank lines created by the above process.
```
W
J
```
Change `W` into `J` so that it sorts between `E` and `N`. (Moving `E` to between `S` and `W` would also work.)
```
%O`.
```
Sort each line into order.
```
+`EJ|NS
```
Delete pairs of opposite directions (this only affects the last line of course).
```
m`^((J)?[EJ]*)((S)?[NS]*)
$#2$*-$.1,$#4$*-$.3
```
Count the number of horizontal and vertical movements, adding signs where necessary.
Those of you who know the differences between Retina 0.8.2 and Retina 1 will want to point out that I can save 2 bytes in Retina 1 because it uses `*` instead of `$*`. While I was there I tried to simplify the splitting process but I was unable to reduce the byte count further, I was only able to equal it with this:
```
L$`$(?<=(.*))|[NS]?[EW]?
$&$1
```
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), ~~40~~ 32 [bytes](https://codegolf.meta.stackexchange.com/a/9429/78410)
```
2((⊢,+/)1⊥¨0j1*⊢⊂⍨1,2≤/|)'NWS'∘⍳
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///30hD41HXIh1tfU3DR11LD60wyDLUAgo86mp61LvCUMfoUecS/RpNdb/wYPVHHTMe9W7@n/aobcKj3r5HXc2H1hs/apv4qG9qcJAzkAzx8Az@b6lgaAhUqPdoeneagrpfsGu4OheqWHB4sKufn2twuJ8ruhRQ2DXYNTg4PNwPQ5urq6s6AA "APL (Dyalog Unicode) – Try It Online")
It turns out that we don't need PCRE.
### How it works
```
2((⊢,+/)1⊥¨0j1*⊢⊂⍨1,2≤/|)'NWS'∘⍳
                         'NWS'∘⍳  ⍝ V←Map 'NWSE' into 1,2,3,4
2(                     |)  ⍝ Modulo 2 (1 if NS, 0 otherwise)
                    2≤/    ⍝ For each consecutive pair,
                           ⍝ 0 if [NS][EW] combination, 1 otherwise
                  1,  ⍝ Add a leading 1
               ⊢⊂⍨    ⍝ Chunkify V at ones
           0j1*  ⍝ Power of imaginary unit
        1⊥¨      ⍝ Sum within each chunk
  (⊢,+/)  ⍝ Append the grand total to the vector
```
---
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 40 [bytes](https://codegolf.meta.stackexchange.com/a/9429/78410)
```
(⊢,+/)1⊥¨0j1*(⊂'NWS')⍳¨'[NS][EW]|.'⎕S'&'
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///X@NR1yIdbX1Nw0ddSw@tMMgy1AKKNKn7hQeraz7q3XxohXq0X3BstGt4bI2e@qO@qcHqaur/0x61TXjU2/eoq/nQeuNHbRNB4kHOQDLEwzP4v6WCoeGjjhl6j6Z3pymo@wW7hqtzoYoFhwe7@vm5Bof7uaJLAYVdg12Dg8PD/TC0ubq6qgMA "APL (Dyalog Unicode) – Try It Online")
Uses PCRE to divide into segments, and then the power of `0j1` (imaginary unit) to convert the directions to complex numbers. `EW` is mapped to the real part (`E` being positive) and `NS` to the imaginary part (`N` being positive).
`9 11∘.○` in the footer converts the vector of complex numbers into a two-row matrix, by splitting each complex number into its real (top row) and imaginary (bottom row) parts.
### How it works
```
(⊢,+/)1⊥¨0j1*(⊂'NWS')⍳¨'[NS][EW]|.'⎕S'&'
                       '[NS][EW]|.'⎕S'&'  ⍝ Regex search; split into greedy segments
             (⊂'NWS')⍳¨  ⍝ Index of each char within 'NWS' (1 2 3)
                         ⍝ 'E' becomes 4 since it is not found
         0j1*  ⍝ Power of imaginary unit
      1⊥¨      ⍝ Sum within each segment
(⊢,+/)         ⍝ Append its sum on its right
```
[Answer]
# Java 10, ~~269~~ ~~265~~ ~~243~~ ~~238~~ ~~224~~ 219 bytes
```
s->{var r="";int x=0,y=0,t,X,Y,a;for(;!s.isEmpty();r+=X+"|"+Y+" ",s=s.substring(t+1)){a=s.charAt(t=0);var b=s.matches("[NS][EW].*");x+=X=b?1-s.charAt(t=1)/70*2:a<70?1:-a/87;y+=Y=b|a>69&a<87?1-a%2*2:0;}return r+x+"|"+y;}
```
-10 bytes thanks to *@ceilingcat*.
[Try it online.](https://tio.run/##jZBNb8IwDIbv/Aov0qaGftByGIwQ0A45rpccCkIc3FJGGRSUBEQF/e0sVGjaZWJKYiX2Yzt@13hEf734umYb1Bo@sCjPLYCiNLlaYpZDfHsCSKOK8hMy537RlFl/3cSs0QZNkUEMJXC4an90PqICxQlhthSceOhV9hhv4k09ZMudctiTDgottntTOZQpl09cciHu1CVAPM11oA@pbpo5xo0oPaP1ZStU78YxPKTs1iG1vi2abJVrh8xiOZ@JZB60CWUnW5Cn48j/lRTRTi9sdwc47IXjaOBjp99jlcunPL3g6PXtBYf9nk3B566lQlar3BxUCco9NX@rWH29jW33/pBu7MD3uY@7YgFbq91dntkckN6Fq7TJt8HuYIK9DZlN6ZRB5pBYJoLQRsW/IZlIEcdCJvFj1nJCCimTJE4ew@K2xH@4h4z4qVO36us3)
**Explanation:**
```
s->{                  // Method with String as both parameter and return-type
  var r="";           //  Result-String, starting empty
  int x=0,            //  Ending `x`-coordinate, starting at 0
      y=0,            //  Ending `y`-coordinate, starting at 0
      t,X,Y,a;        //  Temp-integers
  for(;!s.isEmpty()   //  Loop as long as the input-String is not empty yet:
      ;               //    After every iteration:
       r+=X+"|"+Y+" ",//     Append the current steps to the result-String
       s=s.substring(t+1)){
                      //     Remove the first `t+1` characters from the input-String
    a=s.charAt(t=0);  //   Set `a` to the first character of the input to save bytes,
                      //   and reset `t` to 0
    var b=s.matches("[NS][EW].*");
                      //   Check if the input-String starts with N/S followed by E/W
    x+=X=             //   Set `X` to (and increase `x` by `X` afterwards):
      b?              //    If the boolean check was truthy:
        1-s.charAt(t=1)/70*2
                      //     Set `X` to 1 if 'E', -1 if 'W'
                      //     And set `t` to 1
       :              //    Else:
        a<70?1:-a/87; //     Set `X` to 1 if 'E', -1 if 'W', 0 if 'N' or 'S'
    y+=Y=             //   Set `Y` to (and increase `y` by `Y` afterwards):
      b|a>69&a<87?1-a%2*2
                      //    Set `Y` to 1 if 'N', -1 if 'S'
       :              //    And if the boolean check was falsey:
        0;}           //     Set `Y` to 0 if 'E' or 'W'
  return r+x+"|"+y;}  //  Append the ending coordinates, and return the result-String
```
[Answer]
# [Perl 5](https://www.perl.org/) `-n`, ~~94~~ 74 bytes
```
map{say$v=/N/-/S/,',',$h=/E/-/W/;$y+=$v;$x+=$h}/[NS][EW]?|E|W/g;say"$x,$y"
```
[Try it online!](https://tio.run/##K0gtyjH9/z83saC6OLFSpcxW309fVz9YX0cdCFUybPVdgdxwfWuVSm1blTJrlQoglVGrH@0XHBvtGh5rX@NaE66fbg3Uq6RSoaNSqfT/f3B4sKufn2twuJ/rv/yCksz8vOL/ur6megaGBv918wA "Perl 5 – Try It Online")
[Answer]
## JavaScript (ES6), 102 bytes
```
f=
s=>s.replace(/((N)|(S))?((E)|(W))?/g,(m,v,n,s,h,e,w)=>(x+=h=!w-!e,y+=v=!s-!n,m?[h,v]+`
`:[x,y]),x=y=0)
```
```
<input oninput=o.textContent=/[^NSEW]/.test(this.value)?``:f(this.value)><pre id=o>0,0
```
Returns a string.
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~75~~ 71 bytes
```
->x{[*x.scan(/[NS][EW]?|./),x].map{|s|s.chars.sum{|c|1i**(c.ord%8%5)}}}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf166iOlqrQq84OTFPQz/aLzg22jU81r5GT19TpyJWLzexoLqmuKZYLzkjsahYr7g0t7omucYwU0tLI1kvvyhF1ULVVLO2tvZ/gUJatFJweLCrn59rcLifq1IsF1gIyHUNdg0ODg/3C4eLuYKgKxIXxnQFif4HAA "Ruby – Try It Online")
-4 bytes thanks to benj2240.
Since returning complex numbers looks to be an acceptable output format, I guess it won't get much golfier than just making a port of the very nice [Lynn's answer](https://codegolf.stackexchange.com/a/163310/78274).
[Answer]
# [F# (Mono)](http://www.mono-project.com/), 269 bytes
```
let f s=
 let l,h=(string s).Replace("NW","A").Replace("NE","B").Replace("SW","C").Replace("SE","D")|>Seq.map(function 'N'->0,1|'S'->0,-1|'W'-> -1,0|'E'->1,0|'A'-> -1,1|'B'->1,1|'C'-> -1,-1|'D'->1,-1)|>Seq.mapFold(fun(x,y) (s,t)->(s,t),(x+s,y+t))(0,0)
 Seq.append l [h]
```
[Try it online!](https://tio.run/##lZCxasMwEIZ3P8UhKJaIFOwHiMFJ1FFDNWgoHUwiNQZHdiMVEvC7uycR2nQpdNKn7@7nuHNBnEc/LstgIzgImwISDfy0oSFeev8Oga1f7DR0B0uJMoSTljwaiWb7aHTq2f0yqWdP2Nxo@7E@dxN1n/4Q@9FDqUrRVLyeS51BIBkkEDWv5lIiZmjvDsvb7BB2d5cy@yxF/TPjeRyOaQ698hsDGnhkoskPp9dV4LdVZIxWvGIFpEg3TdYfYYDX09tCHeAeWioltcEVGcxN7uqjvQCd8DDReSBPLQFWfH9JkYIYklpqbQye639Jqf4OLF8 "F# (Mono) – Try It Online")
[Answer]
# sed, 125
The *taking liberties with output format* version:
Score includes +1 for the `-r` parameter to sed.
```
s/(N|S)(E|W)/\L\2,\1 /g
s/N|S/,& /g
s/E|W/&, /g
s/N|E/A/gi
s/S|W/a/gi
p
:
s/(\S*),(\S*) (\S*),(\S*)/\1\3,\2\4/
t
s/Aa|aA//
t
```
[Try it online](https://tio.run/##TcqxCoNADAbg2TyInOVK0Hbq5pCtZMmQJYvQIi5Veo4@u9ecpVAC4fv/JD0fOScMvEkTaNMG7W5dtLbCERJ6jbH@2q9Yx19P2OM4OcXroXCBm8dgcmrisas/o7V2idbZFWH1t37Yhh7dObMoAYgKMZMoe3CQkIgqqycqQwcAqEjVexEpr7zPyzrNr5TP7w8).
Output is as follows:
* coordinate elements are comma-separated
* each set of coordinates are TAB-separated
* the final coordinate is on a new line
* all numbers are in ℤ-unary:
	+ a string of `A` characters represents the +ve integer `len(string)`
	+ a string of `a` characters represents the -ve integer `-len(string)`
	+ the empty string represents `0`
For example:
* `,` is [0,0]
* `,AA` is [0,2]
* `aaa,` is [-3,0]
---
# [sed 4.2.2 including GNU exec extension](https://www.gnu.org/software/sed/), 147
The *sensible output format* version:
Score includes +1 for the `-r` parameter to sed.
```
s/(N|S)(E|W)/\L\2 \1\n/g
s/N|S/0 &\n/g
s/E|W/& 0\n/g
s/N|E/1/gi
s/S|W/-1/gi
p
:
s/(\S+) (\S+)\n(\S+) (\S+)/\1+\3 \2+\4/
t
s/\S+/$[&]/g
s/^/echo /e
```
Output is given as space-separated coordinates, one per line. There is an extra newline between the penultimate and ultimate sets of coordinates - not sure if that is problematic or not.
[Try it online!](https://tio.run/##TYyxCsJADIb3PMUNUlpKSVud3LPJLRkyGF201C694nXss3vGQ0QC4fv@PyQO95Qiln7jqqRNKtST9k47nXGEiJZj64qv2QEWrv11hB2OkyFb0WRe4GheKteVy1vnP0Htat077Ws9IKx2aSnuzsUlf7zicHsEh0NKnoUAWJi8JxZvYkBMzCJezOgzlAGAiF5hWacwx9Q83w "sed 4.2.2 – Try It Online")
[Answer]
# PHP, 153 bytes
let a regex do the splitting; loop through the matches, print and sum up the intermediate results:
```
preg_match_all("/[NS][EW]?|E|W/",$argn,$m);foreach($m[0]as$s){$x+=$p=strtr($s[-1],NEWS,1201)-1;$y+=$q=strtr($s[0],NEWS,2110)-1;echo"$p,$q
";}echo"$x,$y";
```
Run as pipe with `-nR` or [try it online](http://sandbox.onlinephpfunctions.com/code/78d9cd6eb9c8892e3e9fdb036fe509e3fafc307d).
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 173 bytes
It's interesting doing this one in a language with no regex support!
```
f(char*s){char*t="[%d,%d]\n";int x[4]={0},i;for(;*s;*x=x[1]=!printf(t,x[1],*x))for(i=-1;i<5;)if(*s=="S NW E"[++i]){x[i/3+2]+=x[i/3]=i%3-1;i+=2-i%3;s++;}printf(t,x[3],x[2]);}
```
[Try it online!](https://tio.run/##TY69bsMwDIT3PIXqwoD@3NZ2MzHMljVLhgyqBkOOEwKNU1huYMDws6uSpy7kR/B4PFdcnQuv1Lvv3/bCdn5s6fF224eOu1szSC/mtY@YmbzVeWu/@gyoH9lkPi3OH4sm6B4DB@lBTjiZ0uLLzxAVHR91GrWchEgSwqIE2m1BUMelR8xO7Hhmh8woRVbMk6H3WlVW4UoWKa/ThcKqiAheKVj@Wdc2lsoKWEIKdG@o5wma4ep0Ss2kjPwUbN4wFn@mxb4UbKVnjCZgs4RwPJ0Pfw "C (gcc) – Try It Online")
]