eclipse使用regex和find-replace将数字值括在单引号中 [英] eclipse use regex with find-replace to surround numeric values with single quotes

查看:50
本文介绍了eclipse使用regex和find-replace将数字值括在单引号中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用eclipse打开了一个html文件,我的意图是将 colspan = 4 替换为 colspan ='4'.或相应地,将 colspan = 3 替换为 colspan ='3'.您可以帮我找一个合适的正则表达式,与查找并替换"一起使用吗?

i have an html file opened with eclipse, and my intention is to replace colspan=4 with colspan='4' . or, accordingly, replace colspan=3 with colspan='3'. Can you help me with a suitable regular expression to be used with 'find and replace'?

推荐答案

查找: colspan =(\ d +)
替换: colspan ='\ 1' colspan ='$ 1'

注意:在查找"对话框中启用正则表达式时,可以通过在查找/替换"文本字段中按 Ctrl + Space 来获得帮助.

Note: When you enable regexp in the find dialog, you can get help by pressing Ctrl+Space in the find/replace text fields.

这篇关于eclipse使用regex和find-replace将数字值括在单引号中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆