# Basic matching
email = "user@example.com"
email =~ /@/ # => 4 (position of match)
email.match?(/@/) # => true
# Capture groups
enum Status {
Ok,
Error(String),
Pending,
}
use std::fmt;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum OrderState {
Pending,
Paid,
#[derive(Debug, Clone)]
pub enum Outcome {
Approve,
Review,
Reject(String),
}