账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    如何实现下面的部分行替换?
    21
    0

    如下面的例子:
    我想将这样包含bytes的行中的packet替换成bytes.

        **rx_bytes2_blob = BlobField('rx proto2 packets' , item_type = int)**--->rx_bytes2_blob = BlobField('rx proto2 *bytes*' , item_type = int)

    我查了下网上有:g/bytes/s/packets/bytes/g;但是这样做不符合我的习惯,我一般是从xx行到yy行进行替换。
    试了下,xx,yy/bytes/s/packets/bytes/g;大概是将其中所有的packets都转成bytes了。

        rx_proto2_blob = BlobField('rx proto2, bytes is the 2nd, ...', item_type = int)
        rx_packets2_blob = BlobField('rx proto2 packets' , item_type = int)
        rx_bytes2_blob = BlobField('rx proto2 packets' , item_type = int)
    
        rx_proto3_blob = BlobField('rx proto3, bytes is the 3rd, ...', item_type = int)
        rx_packets3_blob = BlobField('rx proto3 packets' , item_type = int)
        rx_bytes3_blob = BlobField('rx proto3 packets' , item_type = int)
    
        rx_proto4_blob = BlobField('rx proto4, bytes is the largest, ...', item_type = int)
        rx_packets4_blob = BlobField('rx proto4 packets' , item_type = int)
        rx_bytes4_blob = BlobField('rx proto4 packets' , item_type = int)
    
        rx_proto5_blob = BlobField('rx proto5, bytes is the largest, ...', item_type = int)
        rx_packets5_blob = BlobField('rx proto5 packets' , item_type = int)
        rx_bytes5_blob = BlobField('rx proto5 packets' , item_type = int)
    
        rx_proto6_blob = BlobField('rx proto6, bytes is the largest, ...', item_type = int)
        rx_packets6_blob = BlobField('rx proto6 packets' , item_type = int)
        rx_bytes6_blob = BlobField('rx proto6 packets' , item_type = int)
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部