Tuesday, October 31, 2017

Re: Find and replace through regular expression

Problem Statement

Find (ah0 0.25) and replace it with ((ah0))


Solution:
Use following regular expression

Find: \(([a-z][a-z][0-1]) 0\.\d+\)
replace: ((\1))

Find and replace through regular expression

Problem Statement

Find aa1 and replace it with (aa1)

or find ey0 and replace it with (ey0)

Solution:
Use following regular expression

Find:  ([a-z][a-z][0-1])
replace: (\1)