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 个评论

Okay, what do you have so far?
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?

回答(1 个)

Majed
Majed 2012-11-23
编辑:Walter Roberson 2012-11-24

0 个投票

i GOT THE ANSWER
s = regexprep(s, '(\d+)BC', '<DATE>');
answer is "abc <DATE> xyz"

此问题已关闭。

提问:

2012-11-23

关闭:

2021-8-20

Community Treasure Hunt

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

Start Hunting!

Translated by