Login
|
Signup
langref.org
-
python
add..
all
clojure
cpp
csharp
erlang
fantom
fsharp
go
groovy
haskell
java
ocaml
perl
php
ruby
scala
Home
All
Solved
Unsolved
Strings
Numbers
Regex
Lists
Maps
Structure
Files
Dates
OOP
Networking
XML
Algorithms
Misc
Parallel
View Problem
Regex
Replacing
Replace all regex matches in a string with a static string
Transform
"She sells sea shells"
into
"She X X shells"
by replacing
/se\w+/
with
"X"
python
transformed = re.sub(r'se\w+', 'X', 'She sells sea shells')
transformed = re.sub(r'se\w+', 'X', 'She sells sea shells')
Submit a new solution for
python
There are 15 other solutions in
additional
languages (
clojure
,
cpp
,
csharp
,
erlang
...)