More robust pattern based replacement rules?
- To: mathgroup at smc.vnet.net
- Subject: [mg120765] More robust pattern based replacement rules?
- From: Irretrev Unable <irdeva_ble at yahoo.com>
- Date: Tue, 9 Aug 2011 07:20:42 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
I'm trying to come up with a method for creating somewhat more robust pattern based replacement rules. I've cooked up the following simple example: simpRule = a b v___ - c d v___ -> e v a b - c d /. simpRule produces e - a b + c d /. simpRule produces - a b + c d Is there a way to write one simpRule that can handle both cases? (The actual rule I'm trying to create has to match more terms with a leading coefficient that is more complicated than a simple minus sign, but I figure that for an initial post I should stick with a simple question.) Thanks in advance.
- Follow-Ups:
- Re: More robust pattern based replacement rules?
- From: Leonid Shifrin <lshifr@gmail.com>
- Re: More robust pattern based replacement rules?