![]() |
#1
|
|||
|
|||
![]()
How to Use Wildcards to Find Specific Text Patterns When Some Text is Part of the Text ?Any help would be appreciated
![]() I have list of pattern to search the text , which is Example Patterns: 1.1 1.1(a) 1.12 1.12(a) 1.12(b) Example document to search: 1.1 1.12(a) 1.1(a) 1.12 1.12(a) 1.12(b) 1.1 Issues:
I am using mac so can't use regular expression which just much more easier to do it . PHP Code:
|
#2
|
||||
|
||||
![]()
.Text = "[0-9].[0-9a-z\(\)]{1,}"
Code:
Sub Demo() Application.ScreenUpdating = False Options.DefaultHighlightColorIndex = wdYellow With ActiveDocument.Range With .Find .ClearFormatting .Replacement.ClearFormatting .Text = "[0-9].[0-9a-z\(\)]{1,}" .Replacement.Highlight = True .Replacement.Text = "^&" .Wrap = wdFindContinue .MatchWildcards = True .Forward = True .Format = True .Execute Replace:=wdReplaceAll End With End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
marcotte974 | Word VBA | 2 | 06-22-2022 10:38 PM |
![]() |
Shelley Lou | Word VBA | 2 | 06-21-2021 12:45 AM |
![]() |
LQuinn | Word VBA | 3 | 04-06-2021 04:51 PM |
![]() |
arunchandar9 | Word VBA | 15 | 06-30-2019 01:06 AM |
Using wildcards how do I Find and Add to, not replace | Stargehzer | Word | 3 | 01-25-2016 09:14 PM |