gfpoow 0 Posted April 19, 2012 Report Share Posted April 19, 2012 how to replace text / replace regex first occurred only?there is a text (scraped article), i want to change first occured text only (example i want to replace the -> THEhow to do that? thanks for your help Quote Link to post Share on other sites
JohnB 255 Posted April 19, 2012 Report Share Posted April 19, 2012 You can add the article to a list and check each line and replace whatever you want, but if it occurs twice in a line, it will replace both. John Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted April 19, 2012 Report Share Posted April 19, 2012 Here's the regex code to select the first word occurrence of every line ^\w+\b Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.