+ Reply to Thread
Results 1 to 4 of 4

Word find-replace operation

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-09-2009
    Location
    Greece
    MS-Off Ver
    Office 365
    Posts
    133

    Word find-replace operation

    Hi,

    I am trying to do a find-replace with wildcards that will match strings like:

    την νομίζω
    ΤΗΝ ΝΟΜΙΖΩ
    Την μαρία
    στην Μαρία
    Στην Μαρία
    ΣΤΗΝ ΜΑΡΙΑ

    but will not match strings like:

    την ντουντούκα
    ΤΗΝ ΝΤΟΥΝΤΟΥΚΑ
    Την Ντουντούκα
    στην μπάντα
    Στην Μπάντα
    ΣΤΗΝ ΜΠΑΝΤΑ

    I have used this find string:

    ([Ττ][Ηη])([Νν])( )([μν ΜΝ])

    how can I adapt it so that it keeps matching words staring with "μ" or "ν" but does not match words starting with "μπ" or "ντ"?

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Word find-replace operation

    Maybe this link will provide help ?

  3. #3
    Forum Contributor
    Join Date
    06-09-2009
    Location
    Greece
    MS-Off Ver
    Office 365
    Posts
    133

    Re: Word find-replace operation

    Thanks, I know this page. I could use the [!] symbol, i.e.:

    ([Ττ][Ηη])([Νν])( )(μ[!π])

    but as I understand I would have to break the string in 2 different find/replace operations (and I need to add more similar operations), so I was wondering whether it could be done in a more compact way.

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Word find-replace operation

    You'd better use the VBA replace (without wildcards)

     
    sub snb()
     with activedocument
      .content=replace(replace(.lcase("την ν","tin P"),"την ν","stin P")
     end with
    end sub



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1