Python Forum
Matching whole words in find/replace script
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Matching whole words in find/replace script
#4
On the C:/Temp/Substitutions.txt file I have a list of words separated by space. I want to match a whole word on the left, and replace it with the whole word on the right of the list. For example, if in my substitutions file there is

comp [[comp]]

I do not want it to match words like

computer
uncompare

but only instances of the word "comp" (the word may be preceded and followed by punctuation of course).
Reply


Messages In This Thread
RE: Matching whole words in find/replace script - by greektranslator - Jul-11-2017, 05:03 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  find and group similar words with re? cartonics 4 877 Oct-27-2023, 05:36 PM
Last Post: deanhystad
  package script cant find sibling script when executed from outside Bock 3 1,007 Mar-03-2023, 04:26 PM
Last Post: snippsat
  Working with Excel and Word, Several Questions Regarding Find and Replace Brandon_Pickert 4 1,759 Feb-11-2023, 03:59 PM
Last Post: Brandon_Pickert
  Find and Replace numbers in String giddyhead 2 1,354 Jul-17-2022, 06:22 PM
Last Post: giddyhead
  Regular Expression for matching words xinyulon 1 2,244 Mar-09-2022, 10:34 PM
Last Post: snippsat
  Generate a string of words for multiple lists of words in txt files in order. AnicraftPlayz 2 2,977 Aug-11-2021, 03:45 PM
Last Post: jamesaarr
  Find and replace in files with regex and Python Melcu54 0 1,917 Jun-03-2021, 09:33 AM
Last Post: Melcu54
  find an replace not in all entries Monsterherz 1 2,014 Mar-01-2021, 03:59 PM
Last Post: BashBedlam
  Trying to find first 2 letter word in a list of words Oldman45 7 3,941 Aug-11-2020, 08:59 AM
Last Post: Oldman45
  Find and replace to capitalize with Regex hermobot 2 2,605 Mar-21-2020, 12:30 PM
Last Post: hermobot

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020