Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 01-06-2025, 04:00 PM
batman1 batman1 is offline Find Challenge Windows 11 Find Challenge Office 2013
Advanced Beginner
 
Join Date: Jan 2025
Posts: 57
batman1 is on a distinguished road
Default

Quote:
Originally Posted by gmaxey View Post
Batman1,


English not being your first language, it is understandable that things aren't always are clearly expressed or understood and that is a two way street.

Not to dispute you, but I would like to see a RegEx pattern that returns the same result as the Find\Do While Execute in ScatchMacroC. ScratchMacroC is simple to me because and am much more familiar with the Word Find method and range object than I am with RegEx. I have no doubt that with the right RegEx pattern that processing the data would be more efficient.
I'm curious about the simple code from Find.

Code from Regex e.g.
Code:
Sub test()
Dim RegEx As Object, Matches As Object, Match As Object
    Set RegEx = CreateObject("VBScript.RegExp")
    With RegEx
        .Global = True
        .Pattern ="(?=\d{0,3}2)\d{4,5}"
    End With
    Set Matches = RegEx.Execute(ActiveDocument.Range.text)
    For Each Match In Matches
        Debug.Print Match.Value
    Next
End Sub
OR .Pattern = "(?=(\d){0,3}2)\d{4,5}"
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Any work-around for this challenge RRB Word 6 08-22-2023 11:47 AM
Formula challenge 3 criteria JMC44 Excel Programming 0 04-04-2015 07:38 PM
Find Challenge Challenge for a genius ? e.roberts Office 3 07-13-2012 01:36 AM
Find Challenge Sorting Challenge gbaker Excel Programming 11 06-22-2012 09:39 AM
Find Challenge Word Challenge jpotter2 Word 3 03-22-2011 02:07 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:49 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft