Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9319105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:18:01+00:00 2026-06-19T03:18:01+00:00

how can I implement the following in VIM substitute/regex_this_word/regex_with_another_word_from_the_same_line e.g select ali as name

  • 0

how can I implement the following in VIM

substitute/regex_this_word/regex_with_another_word_from_the_same_line

e.g

select "ali" as name where _placeholder = _placeholder
union
select "sam" as name where _placeholder = _placeholder

after applying

:%s/_placeholder/anythin_between_quotation/

becomes

select "ali" as name where ali = ali
union
select "sam" as name where sam = sam

e.g2

select id, "_placeholder" as vul members_repeater/vul/none

after applying

:%s/_placehold/\=something_like_regexp(getline('.'),'regexp_pattern_to_select_everthing_after_/vul/")

becomes

select id, "none" as vul members_repeater/vul/none 

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T03:18:02+00:00Added an answer on June 19, 2026 at 3:18 am
    :%s/_placeholder/\=split(getline("."),'"')[1]/g
    

    this works in this case:

    • only one quotation part (replacement) in each line
    • the quotation part could be anywhere in this line

    for example:

    select "ali" as name where _placeholder = _placeholder
    union
    select "sam" as name where _placeholder = _placeholder
    select _placeholder where _placeholder = _placeholder "foo"
    select _placeholder where "bar", _placeholder = _placeholder
    

    into

    select "ali" as name where ali = ali
    union
    select "sam" as name where sam = sam
    select foo where foo = foo "foo"
    select bar where "bar", bar = bar
    

    edit

    \=split(getline("."),'"')[1]
     |  |      |
     |  |      +--- get current line text
     |  |
     |  +------ split the line with " as separator, pick the middle part ([1])
     |
     |
     +---- using expression replacement
    

    new edit

    so you can re-use the old routine :

    :%s#_placeholder#\=split(split(getline("."),"vul/")[1]," ")[0]#g
    

    this needs only one vul/ in your line, but there could be text after the keyword (with space as separator) something like:

    select id, "_placeholder" as vul members_repeater/vul/none trashtrash
    

    into

    select id, "none" as vul members_repeater/vul/none trashtrash
    

    see this example :

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I implement the following query with Query Builder? SELECT * FROM t
Can someone please tell me how I can implement the following line of pseudo-code.
How can I implement cross browser opacity gradient (not color gradient)? See following code:
How can I implement following logic? User registers with an e-mail address If provided
How can I implement the following Scenario: I would like to have a signup
How can I implement the following function in C#?
I can not find answers how to implement the following scenario (I do not
With WinGHCi, how can one implement the following code? soma :: Int -> Int
How can I implement following Predicate Example given in Spring DSL: Predicate isWidget =
How can I implement following scenario? I want my FreeBSD kernel to drop UDP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.