RegexWars

Codewars, but the only language is regex.

next daily in --:--:--

Tier 2 · ArchmageextractDaily #95

Sterling Only

Extract the amounts that are prefixed with £ — and not the £ itself.

A lookbehind checks what came before the current position without including it in the match. It is how you match "the bit after the marker" while leaving the marker out.

Your pattern1 chars · par 22
//g
Flags
Start typing — tests run as you go.0 of 3 visible tests passing
Test cases
  • £10 and $20→ ["10"]
  • £3.50 plus £12→ ["3.50", "12"]
  • $99 only→ []

+ 3 hidden tests, checked when you submit. They are what stops a pattern that only fits the examples above.

Solve it, then shrink it

Passing is the easy half. Your score is the length of your pattern, so the real competition starts once it turns green.

No accounts, no setup

Everything runs in your browser. Nothing to install, nothing to sign up for, and every challenge is free — permanently.

68 challenges, eight tiers

From matching a literal word to writing the regex that detects prime numbers. Browse them all.

RegexWars — Codewars, but the only language is regex