[RUBY] Learn regular expressions little by little ①

Introduction

I've been learning programming, and so far, my weakest point is probably "regular expressions". If you google, you can come across as many correct answers as you want, but at least I want to be able to read what they represent, so I will introduce them in several parts.

Regular expressions I met today

Regular expressions meaning
{n} Repeat n times
{n, m} Repeat n times. Up to m times
[] Matches any one of the characters in the brackets
[-] -means something like "kara (~)"
. Match any character
\ d Half-width numbers

at the end

I'm sure the reading depends on the combination. It seems necessary to understand the meaning of each one.

Recommended Posts

Learn regular expressions little by little ①
Regular expressions
Notes on regular expressions
colorize and regular expressions
About regular expressions in Ruby
Rails: Capture regular expressions in emails!
A little regular expression story Part 1
[Rails] Regular batch processing by whenever
Parse Japanese addresses with regular expressions
Implementation of validation using regular expressions
A little regular expression story Part 2
A little understanding of lambda expressions