[Question]
  [
In the language [Nim](https://nim-lang.org "Nim programming language"), the rules for differentiating identifiers are [slightly more relaxed](https://nim-lang.org/docs/manual.html#lexical-analysis-identifier-equality "Nim identifier equality") than most other languages. Two identifiers are equivalent or address the same variable if they follow **these rules**:
* the first character of both **are the same** *(case sensitive)*
* both strings are the same *(case **in**sensitive)* after removing **all instances** of the characters `-` and `_`
## Challenge
Write a **program/function** that takes **two strings** that represent Nim identifiers and output a truthy or falsey value based on **whether or not they are equivalent** by the rules above.
### Specifications
* [Standard I/O rules](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods "Default for Code Golf: Input/Output methods") **apply**.
* [Standard loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default "Loopholes that are forbidden by default") are **forbidden**.
* The strings will **only contain ASCII printables**. You **do not** need to check if it's a valid identifier.
* The strings may be taken as two separate inputs, list of strings, etc. (you know the drill)
* Empty strings **need not** be handled.
* The output **must be consistent** for both truthy and falsey values.
* This challenge is not about finding the shortest approach in all languages, rather, it is about finding the **shortest approach in each language**.
* Your code will be **scored in bytes**, usually in the encoding UTF-8, unless specified otherwise.
* Built-in functions that perform this task are **allowed** but including a solution that doesn't rely on a built-in is encouraged.
* Explanations, even for "practical" languages, are **encouraged**.
## Test cases
```
Input                                    Output
count, Count                             falsey
lookMaNoSeparator, answer                falsey
_test, test                              falsey
test, tset                               falsey
aVariableName, a_variable_name           truthy
numbers_are_cool123, numbersAreCool123   truthy
symbolsAre_too>_>, symbols_areTOO>>      truthy
```
## Ungolfed reference implementation
This is written in Nim, itself.
```
import strutils, re
proc sameIdentifier(a, b: string): bool =
  a[0] == b[0] and
    a.replace(re"_|–", "").toLower == b.replace(re"_|–", "").toLower
```
  
[Answer]
## JavaScript (ES6), ~~62~~ 61 bytes
*Saved 1 byte thanks to [@JohanKarlsson](https://codegolf.stackexchange.com/users/55822/johan-karlsson)*
Takes input in currying syntax `(a)(b)`. Returns a boolean.
```
a=>b=>(r=s=>s[0]+s.replace(/-|_/g,'').toUpperCase())(b)==r(a)
```
### Test cases
```
let f =
a=>b=>(r=s=>s[0]+s.replace(/-|_/g,'').toUpperCase())(b)==r(a)
console.log(f("count")("Count"))                           // falsey
console.log(f("lookMaNoSeparator")("answer"))              // falsey
console.log(f("_test")("test"))                            // falsey
console.log(f("aVariableName")("a_variable_name"))         // truthy
console.log(f("numbers_are_cool123")("numbersAreCool123")) // truthy
```
[Answer]
# [Python 3](https://docs.python.org/3/), 76 bytes
```
lambda a,b:f(*a)==f(*b)
f=lambda f,*r:[f+k.lower()for k in r if~-(k in'-_')]
```
[Try it online!](https://tio.run/##LYmxDsIgFAB3v@Jt8Cq4uDVhYOno4KqGPCIvklJoSFPj4q9jmzjd5W7@LK@Sz20w95Zo8k8CUr5n2REas8Hjgc3/sOpqf@PjeErlHapELhVGiBkqRP5qubvQTuCjzTXmRQ5SkF5tjeRTcBeaglAgrFvp6vamg87WbRWx/QA "Python 3 – Try It Online")
-1 byte thanks to notjagan  
-3 bytes thanks to Wheat Wizard
[Answer]
# [Actually](https://github.com/Mego/Seriously), 15 bytes
```
⌠p"-_"(-Σùo⌡M═Y
```
[Try it online!](https://tio.run/##S0wuKU3Myan8//9Rz4ICJd14JQ3dc4sP78x/1LPQ99HUCZH//yslhiUWZSYm5aT6JeamKukoKCXGl0FF4vNAQgA "Actually – Try It Online")
Fun fact: this works with any number of inputs (it always returns truthy for less than 2 inputs).
Explanation:
```
⌠p"-_"(-Σùo⌡M═Y
⌠p"-_"(-Σùo⌡M    for each input:
 p                 separate the first character
  "-_"(-           remove all dashes and underscores from the rest of the string
        Σù         concatenate the list from the last operation and lowercase the string
          o        append it to the first character
             ═Y  are none of the elements unique?
```
[Answer]
## C++, ~~288~~ 248 bytes
-5 bytes thanks to Zacharý
```
#include<string>
#include<algorithm>
#define E(a,v)a.erase(std::remove(a.begin(),a.end(),v),a.end());
#define F(a)for(auto&c:a)c=toupper(c);
int e(std::string&a,std::string&b){if(a[0]!=b[0])return 0;E(a,45)E(b,45)E(a,95)E(b,95)F(a)F(b)return a==b;}
```
Thanks you, Preprocessor.
Also, this code takes advantage of the fact that in C++ the rule to cast int to bool is `int_var!=0`
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 13 bytes
```
qFm[hd-r0d"-_
```
[Try it online!](http://pyth.herokuapp.com/?code=qFm%5Bhd-r0d%22-_&test_suite=1&test_suite_input=%5B%22count%22%2C+%22Count%22%5D%0A%5B%22lookMaNoSeparator%22%2C+%22answer%22%5D%0A%5B%22aVariableName%22%2C+%22a_variable_name%22%5D%0A%5B%22numbers_are_cool123%22%2C+%22numbersAreCool123%22%5D&debug=0)
# Explanation
```
qFm[hd-r0d"-_
  m              For each value in the input (which is a list of two strings):
   [             Create a list consisting of
    hd               the first character of each value
      -r0d"-_        and the lowercase version of the value without "-" or "_"
qF               Fold over equivalence; checks to see if both lists are the same
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 12 bytes
```
εćs„-_SKl«}Ë
```
[Try it online!](https://tio.run/##MzBNTDJM/f//3NYj7cWPGubpxgd75xxaXXu4@///aKXk/NK8EiUdBSVnMCMWAA "05AB1E – Try It Online")
-1 thanks to [Adnan](https://codegolf.stackexchange.com/users/34388/adnan).
Theoretically, `εćs„-_-«}Ë` should've worked for 10 bytes, but unfortunately this behavior is deprecated for now.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 11 bytes
```
ḟ⁾-_Œl,Ḣµ€E
```
[Try it online!](https://tio.run/##y0rNyan8///hjvmPGvfpxh@dlKPzcMeiQ1sfNa1x/f//f7RSom6ZY1FmYlJOarxfYm6qko5SYnxZYlA8SEg3VTfPMR4oGAsA "Jelly – Try It Online")
-2 bytes thanks to Erik the Outgolfer  
-1 byte thanks to Jonathan Allan
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~86~~ ~~64~~ ~~63~~ ~~61~~ 51 bytes
```
f=->x{x[0]+x.upcase.delete("-_")}
->x,y{f[x]==f[y]}
```
[Try it online!](https://tio.run/##KypNqvz/P81W166iuiLaIFa7Qq@0IDmxOFUvJTUntSRVQ0k3Xkmzlgsor1NZnRZdEWtrmxZdGVv7vwBDKFopUbfMsSgzMSknNd4vMTdVSUcpMb4sMSgeJKSbqpvnGA8UjP0PAA "Ruby – Try It Online")
This ~~feels really long~~ still feels a bit long. I would appreciate the help of any Ruby gurus out there in making this at least a bit shorter.
[Answer]
# CJam, 20 bytes
```
{_"-_"f-:el:=\:c:=*}
```
Takes input in the form of ["string1","string2"].
[Try it Online](http://cjam.aditsu.net/#code=ll%5D%7B_%22-_%22f-%3Ael%3A%3D%5C%3Ac%3A%3D*%7D~&input=numbers_are_cool123%0AnumbersAreCool123) (testing version)
```
{
_      e# make copy of input
"-_"f- e# remove all "-" and "_" from both words in copy
:el    e# convert words in copy to lowercase
:=     e# 1 if both words in copy are equal, 0 if not
\      e# move original version of input to top of stack
:c     e# convert each word in original input to only 1st character
:=     e# 1 if both characters from original input are equal, 0 if not
*      e# multply the two numbers we obtained. If and only if both are 1 (true) we return 1 (true)
}
```
[Answer]
# [Haskell](https://www.haskell.org/), ~~85~~ ~~78~~ ~~76~~ ~~71~~ 68 bytes
*2 bytes saved thanks to Ørjan Johansen*
```
import Data.Char
s(a:x)=a:[toLower a|a<-x,all(/=a)"-_"]
x!y=s x==s y
```
[Try it online!](https://tio.run/##LYzBasMwEETv@QpF9GCB09L2FipDcY9tcmjpJQQxNoKYSFqzklsb@u9uZHzZXd68nQvi1To3z53viZN4Q8J9fQFvYoH9qDT2p0Tv9GtZ4A8vu7GEc8WDhpI7I8@bcTvpKEZ9G9PshBanQrY0hCRLIevlUGUhHdH1Awf6tD0YiViWEiHeapfYJBuXj2Vngm9wh8bZA7zNCczPSkzIKEth8I3laMDWtETu8ek5qyt@ZVuvMMtx8g25TE0iqkyV1RXmhq/jsaqkOm88uqB77kK68@iLIbQD81RslXLzPw "Haskell – Try It Online")
Errors on the empty string.
[Answer]
# [Python 2](https://docs.python.org/2/), 72 bytes
```
lambda x,y:r(x)==r(y)
r=lambda x:x[0]+x[1:].lower().translate(None,"-_")
```
[Try it online!](https://tio.run/##RZDBaoQwFEX3fsUjICTUDp3pTlAos66zaOnGSogzkUpjnrxkpvr11kg6zSaXk3vPIuPsv9Aelq74XIwa2ouCKZtz4pMoCuKzSKj44/lUPzUPU73Pm53BH01c7Dwp64zymldodcYeJROLKeoE1sPZGa/WswzYcQsii9wgfr@qCt/0qEh5pNBZTav0vyS9dtt4u@9YfSjqVWt0pQa97eQtEmkDujftdWg1OalIyzOi2R@eQz/iF9LHCO8LNw8tmvAkPWIpy9CPMGjeT6eyZCJpkqRDAr7@lYDegsk3wUi99asmdcBTJ@DmIMYcUmKQhgWEz81gDmFeQ7dZhFh@AQ "Python 2 – Try It Online")
Won't work with Python 3 because of the new `translate` syntax.
[Answer]
# Excel, 105 bytes
```
=AND(CODE(A1)=CODE(B1),SUBSTITUTE(SUBSTITUTE(A1,"_",""),"-","")=SUBSTITUTE(SUBSTITUTE(B1,"_",""),"-",""))
```
CODE() returns numeric code of first character.
String comparison in Excel is case insensitive.
[Answer]
# [Husk](https://github.com/barbuz/Husk), 13 bytes
```
¤=§,←(m_ω-"-_
```
[Try it online!](https://tio.run/##yygtzv7//9AS20PLdR61TdDIjT/fqaukG//////EsMSizMSknFS/xNzU/4nxZVBufB6QDwA "Husk – Try It Online")
Builds for each string a pair consisting of the first character of the string and the whole string lowercased and with all occurrences of -/\_ removed. Then checks if the two pairs are equal.
A particularity is that `-` in Husk is set difference (i.e. it removes only the first occurrence found): in order to remove all occurrences, the fixed point of `-"-_` is found with `ω-"-_`.
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~14~~ 25 bytes
```
g ¥Vg ©Uu k"_-" ¥Vu k"_-"
```
~~Checks case-insensitive string equality by removing all characters in word 2 from word 1, and removing the `-_` characters; that results in an empty string (`""`) if the words are equal.~~  
*Thanks Ørjan Johansen for pointing out the problem with this.*
Checks first-char equality and if the uppercased inputs are equal after removing `_-`.
[Try it online!](https://codepen.io/justinm53/full/NvKjZr?code=ZyClVmcgqVV1IGsiXy0iIKVWdSBrIl8tIg==&inputs=ImNvdW50IgoiQ291bnQi,Imxvb2tNYU5vU2VwYXJhdG9yIgoiYW5zd2VyIg==,Il90ZXN0IgoidGVzdCI=,ImFWYXJpYWJsZU5hbWUiCiJhX3ZhcmlhYmxlX25hbWUi,Im51bWJlcnNfYXJlX2Nvb2wxMjMiCiJudW1iZXJzQXJlQ29vbDEyMyI=,InN5bWJvbHNBcmVfdG9vPl8+Igoic3ltYm9sc19hcmVUT08+PiI=,InRlc3QiCiJ0c2V0Ig==)
## Explanation
Implicit input: `U` and `V` are input strings
```
g ¥Vg
```
Check if first letter of `U` (implicit) equals (`¥`) the first char of `V`.
```
©Uu k"_-" ¥Vu k"_-"
```
And (`©`) check if `U`, uppercased (`u`) and with `_-` removed (`k`), equals (`¥`) the same for `V`.
Implicitly return the boolean result.
[Answer]
# [R](https://www.r-project.org/), 76 bytes
```
function(l)(g=substr(l,1,1))[1]==g[2]&(h=tolower(gsub('-|_','',l)))[1]==h[2]
```
Anonymous function that takes input as a list of two strings. Takes advantage of the fact that R's string operations, while quite long in # of characters, are vectorized. Additionally wrapping an assignment in parentheses will bind the variable, so `(g=substr(l,1,1))` retains a variable to be reused later in the line and similarly for `h`.
R returns the last evaluated expression as function output.
Ungolfed:
```
function(l){
  g <- substr(l,1,1)
  h <- tolower(gsub("_|-","",l))
  (g[1]==g[2])&(h[1]==h[2])
}
```
[Try it online! (all test cases)](https://tio.run/##RY0xT8MwEIV3fkUmbEvukLKSSKgz7UDFUlWnS3RJKxwfOjsgJP57sKkD00nf@947WYbqcVMtw@z7eGWvndFjE@YuRNHO1rY25lSfm2Y8bc/3@tJEdvxJosfkaLX5BmWVss4U7ZK0ZdC9VpFCVLZSx3RBGXP3Sx3z2zPu@YXeUTCypDr6kBb/FLg1bwMrXFmgf4avKFfsHO1xovwK4aMQ8Bmtop@njiQACkHP7OrtQ9YLfhLaFbgWwtfUscsJROYW2qwXmFeOh0PbJnv5AQ "R – Try It Online")
[Answer]
# [Vyxal 3](https://github.com/Vyxal/Vyxal/tree/version-3), 10 bytes
```
…≈¿ᶴ-_½-ʀ≈
```
[Try it Online!](https://vyxal.github.io/latest.html#WyIiLCIiLCLigKbiiYjCv+G2tC1fwr0tyoDiiYgiLCIiLCJbXCJDb3VudC1cIiwgXCJDb3VudF9fXCJdXG4iLCIzLjQuMCJd)
[Answer]
# [Python 2](https://docs.python.org/2/), ~~79~~ 73 bytes
-6 bytes thanks to @notjagan: check the length of set of all reduced names is 1 or not. 
```
lambda*l:len({x[0]+re.sub('-|_','',x[1:].lower())for x in l})<2
import re
```
[Try it online!](https://tio.run/##bY49b8JADIZ3fsVtlysJKmFDZYiYYaBSF4pODjhqxMWOnAtN1fa3pz0U8SHhyXrsx6/rL//BlPbF4r13UOUHeHJzhxR9d9vn3Vhw0rR5pJMfq2Ot4247ne8mjj9RImMKFtWpkpT7NS/pqKxqFq8E@1pK8qqI9J5b8jpWenluzOgycczHFaz5FWsQ8CxhC6j5v6yNuq@rBW8gJeQO11Dh2bCngVgKyDzUqK1ylMaCoN0zu2k6C/KAM8HlAG8ehOSUDZdvwzY2sAQTymzI6/8A "Python 2 – Try It Online")
[Answer]
# [Perl 5](https://www.perl.org/), 67 bytes
```
s/.//,push@a,$&,y/_-//dr for<>;say($a[0]eq$a[2]&&lc$a[3]eq lc$a[1])
```
[Try it online!](https://tio.run/##K0gtyjH9/79YX09fX6egtDjDIVFHRU2nUj9eV18/pUghLb/Ixs66OLFSQyUx2iA2tRBIGcWqqeUkAxnGQL4CmGUYq/n/f15pblJqUXF8YlFqfHJ@fo6hkTEXVMyxKNU5Xxci9C@/oCQzP6/4v66vqZ6BoQEA "Perl 5 – Try It Online")
Takes the identifiers as input on separate lines.
**Explanation:**
```
s/.//,             # remove the first character
push@a,            # storage space, even positions are first character
                   # odd positions are remainder
$&,                # implicit variable holding last matched pattern (first char)
y/_-//dr           # Remove _ and - from remainder of input
for<>;             # iterate over all input lines
say                # output
($a[0]eq$a[2]&&    # check that first character is identical and
lc$a[3]eq lc$a[1]) # so is the lowercase version of the rest
```
[Answer]
# [Retina](https://github.com/m-ender/retina), 28 bytes
```
T`L\_-`l_`(?<=.).+
^(.*)¶\1$
```
[Try it online!](https://tio.run/##K0otycxL/P8/JMEnJl43ISc@QcPexlZPU0@bK05DT0vz0LYYQ5X//xPDEosyE5NyUv0Sc1O5EuPLoNz4PCAfAA "Retina – Try It Online")
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 29 bytes
```
∧⁼§θ⁰§η⁰⁼↧⪫⪪⪫⪪θ_ω-ω↧⪫⪪⪫⪪η_ω-ω
```
[Try it online!](https://tio.run/##S85ILErOT8z5//9Rx/JHjXsOLT@341HjBiC1HUgBBR61LX@0avWjVasg5Lkd8ec7dc93ogtvhwj//58YlliUmZiUk@qXmJuqkBhfBuXq5gH5AA "Charcoal – Try It Online")
This prints a `-` for truthy and nothing for falsey.
Link to the [verbose version](https://tio.run/##hYuxCgIxEAV/JaTaQAL2VldYKCKCYHusuUACMfGSePHv1y1OsBB81Qy8sR6LzRiJziWkBkOaYDc/MVYY2j5N7gWz3ij9Ec@itFgvx9xdsVgdHHJIcHnE0L5x1kKOUunOiTQMonP9r/K/Kt6WCK9YAt6iO@HdCRyXVU1iJ7OQqfEN). It first compares the first character of both input strings (`⁼§θ⁰§η⁰`) and then compares the rest of both strings after removing the underscores and the hyphens (`⪫⪪⪫⪪θ_ω-ω`) and converting to lowercase (`↧`).
[Answer]
# C#, ~~101~~ 89 bytes
```
string g(string s)=>string.Concat(s.ToUpper().Split('-','_'));f=>s=>f[0]==s[0]&g(f)==g(s)
```
*Saved 12 bytes thanks to @kusi581.*
[Answer]
# [Java (OpenJDK 8)](http://openjdk.java.net/), 95 bytes
```
a->b->a.charAt(0)==b.charAt(0)&&a.replaceAll("_|-","").equalsIgnoreCase(b.replaceAll("_|-",""))
```
[Try it online!](https://tio.run/##bVBdSwMxEHzPrwj3UBLxgu@1xVIQCgpCH0XKXrqtqbkkJnvVUvvbz5y9Wvx4m5kddmZ3A1sofUC3Wb60pg4@Et9kTTVkrLoYsj/aqnGajHfdkIWmskZzbSElfg/G7dnNbW8AO3OEcQUaWSKg7DMngU@bRL5@iLg0Ggj37Btezykatx5zCMHuxJFxiGs5ZIdTYL9v682S1zm2tz0@dcYk9@zXfh4y4iPeQjmuyjEo/QxxQuJKjkbVmQwGoCIGmxtOrBXF4qMsLotCKnxtwKbZ2vmIU0goqn99sh2yuQbnMPKU4xy@8Z6L@S4R1sq4fEePfUMq5N5knegKquPJSTl8pzvjUEipCBP9lL4ecWjzYFES6@af "Java (OpenJDK 8) – Try It Online")
Pretty straight forward.
[Answer]
# [Pyke](https://github.com/muddyfish/PYKE), 13 bytes
```
F'hl1"-_"-)Xq
```
[Try it online!](https://tio.run/##K6jMTv3/3009I8dQSTdeSVczovD/f6Xk@PzSvBJdJR0FpWQQK14JAA "Pyke – Try It Online")
```
F         )   -  for i in input():
 'hl1         -   i[0], i.lower()
     "-_"-    -         ^.remove("-_")
           Xq - equal(^)
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~126~~ 114 bytes
```
#define p(s)do++s;while(*s==45||*s==95);*s>95?*s-=32:0;
f(char*a,char*b){while(*a&&*a==*b){p(a)p(b)}return*a==*b;}
```
[Try it online!](https://tio.run/##LYzNEsEwFIX3niLDMEm0htJFRXgDSxuMuU1SzUwbnaRY0GcPKatzv/NzRXwVwvuRVIU2CjXYEXmbTh17lrpSmDrOV@n7HTRLCaNum6U76mK@TNZzNiiwKMFSiHrJyes/g8mEAufBaTCQBueks6q9W/OzWedH2ojqLhXauFbq26zcDrRpUQ3a4HCAvYoI9X9pgAdBL9TYb1Tg4ViezDBCBQ7BcXGO@sYxORPCUOc9HMBqyCu1h1p5uDz@GJsvfwA "C (gcc) – Try It Online")
With whitespace and comments:
```
#define p(s)                   // Define helper macro p           \
    do ++s;                    // Increment pointer at least once \
    while (*s==45 | *s==95);   // and past any '-' or '_'         \
    *s>95 ? *s -= 32 : 0;      // If lowercase letter, convert to upper
f(char* a, char* b) {          // Define main function f
    while (*a && *a == *b) {   // Loop until end of either string
                               // or a difference found
        p(a)                   // Transform pointer and one char
        p(b)                   // via helper p above
    }
    return *a==*b;             // Test chars equal (on success, both '\0')
}
```
[Answer]
# Dyalog APL, ~~47~~ ~~32~~ ~~28~~ ~~27~~ ~~26~~ 22 bytes
-4 bytes thanks to Kritixi Lithos
```
{(=/⊃¨⍵)∧≡/819⌶⍵~'-_'}   
```
Takes input as a list of the strings.
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v//Ud/UR20TqjVs9R91NR9a8ah3q@ajjuWPOhfqWxhaPurZBhSoU9eNV69Vjy9JLS5RV1CPDwHR//8DAA)
### How?
```
{(=/⊃¨⍵)∧≡/819⌶⍵~'-_'}
               ⍵~'-_'   Remove '-' and '_'
           819⌶         Lowercase
         ≡/             Equality between elements
        ∧               And
 (=/⊃¨⍵)                The first element of each element is equal
```
[Answer]
# Common Lisp, 98 bytes
```
(lambda(x y)(and(eql(elt x 0)(elt y 0))(string-equal(#1=remove #\-(#1##\_ y))(#1##\-(#1##\_ x)))))
```
[Try it online!](https://tio.run/##PY9Ba8MwDIX/inAYk2GBdTsvMHpee9jYqWCUVCthjpU6Ttdc8tc7OQvzwU/@3pPhNb4d@ht6kR6@JAJeYbLQBrhHNI2MIRkw20UtoNHc9xvt5J17ipQkqkth@OG42C7xkBcWyYA@KbZUe95RxznrLitwIROLJoxdzXFwFNk1In7z9KzBlb5G3q5Mo8PU1eIzdEmkcpUGV5bXP/b7qjLWwlEAtUxHCRKYmR5gJigrvec7A9oQUCtTVx9p6YsUjshnj@yT2o92GSYdLA4ptuFU8nkkj8XmJXInF4biUOqrKA5O9@3f@E@uNp9b/lrlFw)
Ungolfed (super straightforward!) version:
```
(defun f(x y)
  (and (eql (elt x 0) (elt y 0))         ; check if initial characters are identical
       (string-equal                     ; string comparison (case insensitive)
         (remove #\- (remove #\_ y))     ; remove from both strings the unwanted chars
         (remove #\- (remove #\_ x)))))
```
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 17 bytes
```
hᵛ&{{¬∈"_-"&ụ}ˢ}ᵛ
```
[Try it online!](https://tio.run/##Pc6xSsRAEIDhVwlTpLoTPPsFudq7QrEJxzIJoyduMrK7MRwxjYLEzv46QWwsbK7RztanSF4kd7MEqx2@@Rk2tZitN4avZ0NdQTRVEVRx3T9/9Y9PffsB3pYEDzJdoXEETQVHEXTfL023ex3W3W4b1/XvZ9@2oKcQdz/vzd/bYbcdhiSBjMvCwySCeRhWkwTwEu0NpoYWmJOsUN@PogshiQzz7Rku@Jzu0KJnG8LCVWTDvijzlKzTaElnzOZ4diLFyKeW5iNK7DZ5ykZUe2allaQjyoWL5VKpUGpPLnw3vCL/4OgAqz0 "Brachylog – Try It Online")
Outputs through predicate success/failure.
```
h                    The first element
 ᵛ                   is the same for each element of the input,
  &                  and
   {           }ᵛ    for each element of the input the following are the same:
    {      &ụ}ˢ      every element uppercased which satisfies the condition that
     ¬∈              it is not an element of
       "_-"          the string "_-".
```
[Answer]
# Erlang 113 bytes
```
A=fun(L)->string:to_lower(lists:flatten(string:tokens(L,"-_")))end,fun([C|D],[C|E])->A(D)==A(E);(_,_)->a==b end.
```
a pair of anonymous functions that compare the two lists. meant to be pasted in the erlang shell.
more readable:
```
A=fun(L) ->
    string:to_lower( % case insensitive
        lists:flatten( % squash all characters back into one list
            string:tokens(L,"-_") % return a list of list of characters
        )
    )
end.
fun([C|D],[C|E]) -> % are the first characters exactly the same?
    A(D)==A(E); % does the rest compare correctly?
   (_,_) -> % first chars not the same
    a==b % shorter than 'false'
end.
```
[Answer]
# [Clip](https://esolangs.org/wiki/Clip), 25 bytes
```
&=(x(y=AxAy[Aa--m.L`a'-'_
```
**Explanation**:
`x`, `y` and `z` may be referenced in a Clip program to implicitly take up to three inputs. Since this program only references `x` and `y`, it takes two inputs which are assigned to `x` and `y`.
```
 =(x(y                    First characters of x and y are equal
&                         And
      =AxAy               A(x) == A(y)
           [Aa            Function A, takes parameter a
                m.L`a     Map all elements of a to lower case
              --     '-'_ Remove all occurrences of '-' and '_'
```
Takes two strings from standard input, outputs `1` and `0` for true and false respectively.
]