Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

improved test code
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

JavaScript (ES6), (削除) 40 (削除ここまで) 38 bytes

A function made of 19 distinct characters used twice each.

_=>_.match`[\\]chmt[-a.02:=>?^^-]`?2:0

Try it online! Try it online!

How?

The range going from [ to a allows us to match the backtick and the underscore, which are both already doubled in the code, without explicitly including them in the pattern.

This method comes with two minor drawbacks:

  • Because this range also includes ^, we need to insert it twice in the code as well although it's not part of the payload.
  • We also have to insert a second -.

Character set:

-.02:=>?[\]^_`achmt

JavaScript (ES6), (削除) 40 (削除ここまで) 38 bytes

A function made of 19 distinct characters used twice each.

_=>_.match`[\\]chmt[-a.02:=>?^^-]`?2:0

Try it online!

How?

The range going from [ to a allows us to match the backtick and the underscore, which are both already doubled in the code, without explicitly including them in the pattern.

This method comes with two minor drawbacks:

  • Because this range also includes ^, we need to insert it twice in the code as well although it's not part of the payload.
  • We also have to insert a second -.

Character set:

-.02:=>?[\]^_`achmt

JavaScript (ES6), (削除) 40 (削除ここまで) 38 bytes

A function made of 19 distinct characters used twice each.

_=>_.match`[\\]chmt[-a.02:=>?^^-]`?2:0

Try it online!

How?

The range going from [ to a allows us to match the backtick and the underscore, which are both already doubled in the code, without explicitly including them in the pattern.

This method comes with two minor drawbacks:

  • Because this range also includes ^, we need to insert it twice in the code as well although it's not part of the payload.
  • We also have to insert a second -.

Character set:

-.02:=>?[\]^_`achmt
Commonmark migration
Source Link

#JavaScript (ES6), (削除) 40 (削除ここまで) 38 bytes

JavaScript (ES6), (削除) 40 (削除ここまで) 38 bytes

A function made of 19 distinct characters used twice each.

_=>_.match`[\\]chmt[-a.02:=>?^^-]`?2:0

Try it online!

###How?

How?

The range going from [ to a allows us to match the backtick and the underscore, which are both already doubled in the code, without explicitly including them in the pattern.

This method comes with two minor drawbacks:

  • Because this range also includes ^, we need to insert it twice in the code as well although it's not part of the payload.
  • We also have to insert a second -.

Character set:

-.02:=>?[\]^_`achmt

#JavaScript (ES6), (削除) 40 (削除ここまで) 38 bytes

A function made of 19 distinct characters used twice each.

_=>_.match`[\\]chmt[-a.02:=>?^^-]`?2:0

Try it online!

###How?

The range going from [ to a allows us to match the backtick and the underscore, which are both already doubled in the code, without explicitly including them in the pattern.

This method comes with two minor drawbacks:

  • Because this range also includes ^, we need to insert it twice in the code as well although it's not part of the payload.
  • We also have to insert a second -.

Character set:

-.02:=>?[\]^_`achmt

JavaScript (ES6), (削除) 40 (削除ここまで) 38 bytes

A function made of 19 distinct characters used twice each.

_=>_.match`[\\]chmt[-a.02:=>?^^-]`?2:0

Try it online!

How?

The range going from [ to a allows us to match the backtick and the underscore, which are both already doubled in the code, without explicitly including them in the pattern.

This method comes with two minor drawbacks:

  • Because this range also includes ^, we need to insert it twice in the code as well although it's not part of the payload.
  • We also have to insert a second -.

Character set:

-.02:=>?[\]^_`achmt
added an explanation
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

#JavaScript (ES6), (削除) 40 (削除ここまで) 38 bytes

A function made of 19 distinct characters used twice each.

_=>_.match`[\\]chmt[-a.02:=>?^^-]`?2:0

Try it online!

###How?

The range going from [ to a allows us to match the backtick and the underscore, which are both already doubled in the code, without explicitly including them in the pattern.

This method comes with two minor drawbacks:

  • Because this range also includes ^, we need to insert it twice in the code as well although it's not part of the payload.
  • We also have to insert a second -.

Character set:

-.02:=>?[\]^_`achmt

#JavaScript (ES6), (削除) 40 (削除ここまで) 38 bytes

A function made of 19 distinct characters used twice each.

_=>_.match`[\\]chmt[-a.02:=>?^^-]`?2:0

Try it online!

#JavaScript (ES6), (削除) 40 (削除ここまで) 38 bytes

A function made of 19 distinct characters used twice each.

_=>_.match`[\\]chmt[-a.02:=>?^^-]`?2:0

Try it online!

###How?

The range going from [ to a allows us to match the backtick and the underscore, which are both already doubled in the code, without explicitly including them in the pattern.

This method comes with two minor drawbacks:

  • Because this range also includes ^, we need to insert it twice in the code as well although it's not part of the payload.
  • We also have to insert a second -.

Character set:

-.02:=>?[\]^_`achmt
saved 2 bytes
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670
Loading
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670
Loading

AltStyle によって変換されたページ (->オリジナル) /