Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1242.Regular expression replace -- How to replace alt text with string from title tag?

User: yong -- 2014-09-04          << 1241  1243 >>
Hits: 1127
Type: Regular expression replace   
Search all Regular expression replace examples
Description:
I want to replace words like this, this is a big text article! please see the text sample!
Input Sample:
<title>title one</title>
blah blah blah blah blah 

blah blah blah blah blah  alt="to be changed"  blah blah

<title>title two</title>
blah blah blah blah blah 

blah blah blah blah blah  alt="to be changed"  blah blah

<title>title three</title>
blah blah blah blah blah 

blah blah blah blah blah  alt="to be changed"  blah blah

Output Sample:
<title>title one</title>
blah blah blah blah blah 

blah blah blah blah blah  alt="title one"  blah blah

<title>title two</title>
blah blah blah blah blah 

blah blah blah blah blah  alt="title two"  blah blah

<title>title three</title>
blah blah blah blah blah 

blah blah blah blah blah  alt="title three"  blah blah

Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open text file
2. ctrl-h open 'replace' dialogue
* set 'search for pattern' to:

* set 'Replace with pattern' to:

3. click 'replace', done.

Note: if you need to replace multiple alt="***" after each <title> section, you can make following change in step 2:
* set 'search for pattern' to:

* set 'Replace with pattern' to:


Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Window


Similar Examples:
How to replace the quoted text with lines from another file? (66%)
How to replace some text with a random line from another file? (63%)
How to replace non-fixed text pattern in a html file? (63%)
How to replace string in the Nth file with the Nth strings from a list? (60%)
How to replace a repeated string in unsequenced order? (60%)
How to replace a string that not enclosed by specific html tag? (60%)
How to add spaces to align text to the center in a text file? (60%)
How to replace text files using multiple pre-defined rules? (59%)

Check Demo of Regular expression replace
Keywords:
big text  big  alt  tag  title  after  string  regular expression  expression  regular  this after  replace string multiple file  multiple string  replace text after match  multiple words  a tag  h tag  replace text after