Regular Expression brain teaser

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to substitute for two words using a single Regex command. I would like to do the following substitutions in a text fil

From "sans" to "without
From "stupid" to "questionable

Using two Regex passes is simple. Can it be done in one?
 
Hi,
There is no way you can substitute two different matches in the same
run. But the one way you might be able to do this is if the words "sans"
and "stupid" occur in the following machine

sans ... stupid .... sans .... stupid......

So you can write a regular expression for that pattern and then replace
them. But if two sans appear consecutively, then you will have the problem.

Thanks
Anand Balasubramanian
Microsoft, Visual Basic .NET

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only. Thanks
 
Back
Top