Wolfram.com
WolframAlpha.com
WolframCloud.com
Wolfram Language
Example Repository
Ready-to-use examples of the Wolfram Language
Primary Navigation
Categories
Astronomy
Audio Processing
Calculus
Cellular Automata
Chemistry
Complex Systems
Computer Science
Computer Vision
Control Systems
Creative Arts
Data Science
Engineering
Finance & Economics
Finite Element Method
Food & Nutrition
Geography
Geometry
Graphs & Networks
Image Processing
Life Sciences
Machine Learning
Mathematics
Optimization
Physics
Puzzles and Recreation
Quantum Computation
Signal Processing
Social Sciences
System Modeling
Text & Language Processing
Time-Related Computation
Video Processing
Visualization & Graphics
Alphabetical List
Submit a New Resource
Learn More about
Wolfram Language
Related Pages
Related Symbols
Molecule
MoleculeModify
MoleculePattern
MoleculePlot3D
Related Categories
Chemistry
Molecule Substructure Replacement
Replace molecular patterns in cyclopentane
Example Notebook
Open in Cloud
Download Notebook
Consider the molecule of cyclopentane:
I
n
[
1
]
:
=
m
=
M
o
l
e
c
u
l
e
[
"
c
y
c
l
o
p
e
n
t
a
n
e
"
]
;
M
o
l
e
c
u
l
e
P
l
o
t
3
D
[
m
]
O
u
t
[
1
]
=
Use
M
o
l
e
c
u
l
e
M
o
d
i
f
y
to replace every hydrogen atom with a benzene ring:
I
n
[
2
]
:
=
m
2
=
M
o
l
e
c
u
l
e
M
o
d
i
f
y
[
m
,
{
"
R
e
p
l
a
c
e
S
u
b
s
t
r
u
c
t
u
r
e
"
,
"
H
"
M
o
l
e
c
u
l
e
[
"
b
e
n
z
e
n
e
"
]
}
]
O
u
t
[
2
]
=
M
o
l
e
c
u
l
e
F
o
r
m
u
l
a
:
C
6
5
H
5
0
A
t
o
m
s
:
1
1
5
B
o
n
d
s
:
1
2
5
Show the new molecule:
I
n
[
3
]
:
=
M
o
l
e
c
u
l
e
P
l
o
t
3
D
[
m
2
,
P
l
o
t
T
h
e
m
e
"
T
u
b
e
s
"
]
O
u
t
[
3
]
=
Now replace the central 5-membered ring with a cyclodecane, which is a 10-membered ring. Provide the attachment points as a list of rules from pattern index to replacement index:
I
n
[
4
]
:
=
m
3
=
M
o
l
e
c
u
l
e
M
o
d
i
f
y
[
m
2
,
{
"
R
e
p
l
a
c
e
S
u
b
s
t
r
u
c
t
u
r
e
"
,
M
o
l
e
c
u
l
e
P
a
t
t
e
r
n
[
"
C
1
C
C
C
C
1
"
]
M
o
l
e
c
u
l
e
[
"
c
y
c
l
o
d
e
c
a
n
e
"
]
,
{
1
1
,
2
3
,
3
5
,
4
7
,
5
9
}
}
]
O
u
t
[
4
]
=
M
o
l
e
c
u
l
e
F
o
r
m
u
l
a
:
C
4
H
1
0
O
2
S
2
A
t
o
m
s
:
1
8
B
o
n
d
s
:
1
7
Show the new molecule:
I
n
[
5
]
:
=
M
o
l
e
c
u
l
e
P
l
o
t
3
D
[
m
3
,
P
l
o
t
T
h
e
m
e
"
T
u
b
e
s
"
]
O
u
t
[
5
]
=
See Also
MoleculeRingPattern
Related Symbols
Molecule
MoleculeModify
MoleculePattern
MoleculePlot3D
Publisher Information
Contributed by:
Wolfram Staff