Regular Expressions 101

Create a 3 letter acronym

Open Workspace
  • Python
  • Match
1

Regular Expression

r"
(^[A-Za-z]|(?<=[^\w])[A-Za-z]|(?<![A-Z])[A-Z])
"
g

Description

The meaning of the Regexp is create a 3 letters acronym from a given string.

i.e. Ruby on Rails = RoR HyperText Markup Languague = HTML

Submitted by Juan Mesa <linuxven@gmail.com>