我有以下字符串。
x = %q{ On the server side, my EJB3 application uses Spring for configuring all sorts of things. So my EJBs all look up various ApplicationContexts and use them as a sort of...well, I was going to say poor man's JNDI, but the reality is that JNDI in the J2EE environment is really a poor man's Spring. :-)
On the GUI side, I use it instead of resource injection to get access to my EJBs. That lets me test the GUI component with simple pojos. So ejb is very good technology}
我正在替换字符串"ejb"
,不区分大小写。我正在这样做:
y = x.gsub(/(ejb)/i, '<em>EJB</em>')
# => " On the server side, my <em>EJB</em>3 application uses Spring for configuring all sorts of things. So my <em>EJB</em>s all look up various ApplicationContexts and use them as a sort of...well, I was going to say poor man's JNDI, but the reality is that JNDI in the J2EE environment is really a poor man's Spring. :-)\n\nOn the GUI side, I use it instead of resource injection to get access to my <em>EJB</em>s. That lets me test the GUI component with simple pojos. So <em>EJB</em> is very good technology"
我有一个小写匹配: "ejb"
,我用这个替换: "<em>EJB</em>"
。如何在不更改大小写的情况下更换它?我想要"<em>ejb</em>"
。