python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Is there a way to use a regex inside a python pattern match?
This is common across functional languages that support pattern matching, so my intuition wants this to be possible.
I am looking for something like:
match string:
case "[a-zA-Z]":
...
777bpc
Votes: 0
Answers: 2
Parametrized pattern matching issue
Suppose I have the following type hierarchy
sealed trait Animal
case class Dog(name: String) extends Animal
case class Cat(age: Int) extends Animal
Then if given as: List[Animal] I want to drop all...
micsza
Votes: 0
Answers: 0
Weird type when pattern matching references
I encountered this strange behaviour when reading this post, and the core question of this post is when you matching (&k, &v) = &(&String, &String) , k and v will get the type Stri...
Steve Lau
Votes: 0
Answers: 2
Can you pattern match integers to ranges in OCaml?
As part of Graham's Scan, I am writing a function that determines whether the line is turning left or right at a certain point. Considering we have a function determinant point -> point -> point...
ice-wind
Votes: 0
Answers: 2