当前位置: 动力学知识库 > 问答 > 编程问答 >

regex - Sublime Text 2 - Regular Expression Find and Replace

问题描述:

I am looking for a solution to find and replace the formatting of many prices within one of my documents.

I currently have prices that are formatting like so: $60 and would like to change the formatting to: 60 $

The following 'Find What' works to find the first format \$\d{0,2} but not too sure about what to 'Replace With'.

Is there a way to preserve the number?

Thank you.

网友答案:

Try this:

find: \$(\d{0,2})
replace: \1 $

网友答案:

Option+Cmd+F:

Place into the find field:

\$([0-9]{0,2})

Place into the replace field:

\1 \$

The backslash + number indicated which capture group to place in there.

分享给朋友:
您可能感兴趣的文章:
随机阅读: