Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
XML に 1 つのノードを追加する正規表現を作成しようとしています。
私の現在のxmlは次のとおりです。
<A> <B>some value</b> </A>
私の予想されるxmlは次のとおりです。
<A> <B>some value</b> <C>some new value</C> </A>
だから私はC要素を追加したい。
誰でも正規表現を書くのを手伝ってもらえますか?私は正規表現を書くのが初めてです。
ありがとう
素早くハックしたい場合は、次のようなものが機能するはずです。
s/\(<B>.*<\/b>\)/\1<C>Some new value<\/c>/