lundi 15 mai 2017

How to match a single character in string with regex?

Hi i'm using regex to match a string

str = Milk

str.match(/^.*?lk.*?$/i)

For single character this is fine. How can check the whole string and replace the matched character using ruby regex pattern?

Aucun commentaire:

Enregistrer un commentaire