Welcome to WebmasterWorld Guest from 54.226.62.26

Forum Moderators: open

Message Too Old, No Replies

Regular Expressions & Math Operations

     

omid_79

10:13 pm on Jan 25, 2007 (gmt 0)

5+ Year Member



Is there a way to perform math operation using regular expressions?
I use HomeSite, and using Extended replace with Regular Expressions, I am able to locate/replace a code, but can not find how to perform math operations on the found code.

Okay, let me explain this better. What i'm trying to do is using Extended replace find prices on my pages and do some math operations with them. So far using extended replace i can find the prices, but how do i perform math operations on them. is this possible?

I use the following RegEx to locate the code:
Price ([$][0-9.]*)
but can not do this for example
/1 * 2 , i want to simply take the value stored in the first variable and multiply it by 2.

Any help would be greatly appreciated.

sgietz

11:15 pm on Feb 12, 2007 (gmt 0)

5+ Year Member



You can't do that with RegEx. You need some other programming language to manipulate the match(es), such as Javascript, VB or PHP.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month