I'm getting an array of excel macros, using regexp instead of calling a problem regex.execute (string) instead of calling By the group capturing, I always get a single return which is the full string specified in the pattern. Using the same pattern, I can see well-grouped return. What I'm missing from:
Private Sub ParseFileName (as strInput string) Dim regex New RegExp dim strPattern string retard strReplace 'sample string \\ Work_DIR \ FTP \ result form As in \ Rev. \ FTP_01_01_06_Results \ 4F \ ACC2X2R33371_SASSSD_run1 strPattern = "FTP _ (\ w +) _ \\ (\ w +) \\ ([\ d, \ D]) _ (SAS | SATA) (HDD) | SSD) _run (\ d) "with regex. Globals = true .MultiLine = false .IgnoreCase = false .Pattern = strPattern then ends with regEx.Test (strInput) then set strReplace = regEx.Execute (strInput) ActiveCell. Offset (0, 1) = strReplace.Count or ActiveCell. Offset (0, 1) = "(not matched)" end if ending sub
Finally, strReplace.Count
always displays 1, which is complete String FTP_01_01_06_Results \ 4F \ ACC2X8R133371_SASSSD_run1
No comments:
Post a Comment