macutan:
mash!!!, thanks a lot for your prompt response, your regex works when y try it on http://www.gskinner.com/RegExr/ but when i put it on my yahoo pipe code it doesn't seem to work, it comes back as: 8,500 / month Negotiable, 1,237 sqft / 115 sqm (built-in) - Condominium, Cairnhill Rise (D09)
see pipe address here: http://pipes.yahoo.com/pipes/pipe.info?_id=98485b176778798d46a8f0ed78b770ef (this particular regex is the one for the middle column of boxes).
also is the number that you are capturing through this regex a number or text? (gskinner.com editor comes back with 8,500)...
I've never use Yahoo pipes before today so don't hold me to any of this. Apparently it does a replace.
With a regex replace you replace what was matched. Anything that wasn't match is left untouched. So in the whole string only "S$ 8,500" is replaced by "8,500" which is not what you want. You want the entire line to be replaced so you have to match the entire line.
Change the regex to
S\$\x20*(\d{1,3}(?:,\d{3})*).+
check the 's' in your regex module as well.
Replace with
$1
macutan: thanks once again for your input but i do not know what am i doing wrong... also how did you come up to your regex pattern? (years of experience?)
macutan
Yes, several years
EXPLANATION
----------------------------------------------------------------------
S 'S'
----------------------------------------------------------------------
\$ '$'
----------------------------------------------------------------------
\x20* character 32 (0 or more times (matching
the most amount possible))
----------------------------------------------------------------------
( group and capture to \1:
----------------------------------------------------------------------
\d{1,3} digits (0-9) (between 1 and 3 times
(matching the most amount possible))
----------------------------------------------------------------------
(?: group, but do not capture (0 or more
times (matching the most amount
possible)):
----------------------------------------------------------------------
, ','
----------------------------------------------------------------------
\d{3} digits (0-9) (3 times)
----------------------------------------------------------------------
)* end of grouping
----------------------------------------------------------------------
) end of \1
----------------------------------------------------------------------
.+ any character except \n (1 or more times
(matching the most amount possible))
----------------------------------------------------------------------
Michael
"In theory, theory and practice are the same. In practice, they are not."
Albert Einstein