Regular expression replace problem ?

Hi every one ,
I need to replace every decimal number by a special tag like <NUM> in a given text
Thanks

3 Comments

Okay, what do you have so far?
Majed
Majed on 23 Nov 2012
Edited: Walter Roberson on 23 Nov 2012
i GOT THE ANSWER
BUT THE PROBLEM i HAVE IS
HOW TO REPLACE "abc 123BC xyz"
to "abc <DATE> xyz"
Okay, what do you have so far?

Answers (1)

Majed
Majed on 23 Nov 2012
Edited: Walter Roberson on 24 Nov 2012
i GOT THE ANSWER
s = regexprep(s, '(\d+)BC', '<DATE>');
answer is "abc <DATE> xyz"

This question is closed.

Asked:

on 23 Nov 2012

Closed:

on 20 Aug 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!