Telson Alva
Telson Alva

Reputation: 862

VBScript Return an entire line when searching for a string

I want to return a whole line when I find the search string in the line. Similar to this one

I know I can use this method found here

I wanted to know if there was an alternate way other other than doing a Regex on each individual line. I like FINDSTR, search for a term and it returns the whole line. Now I could also output that to a text file and read the text file instead, but I was wondering if there was a better way.

Upvotes: 0

Views: 810

Answers (1)

CptVince
CptVince

Reputation: 89

When you can multiline with RegEx in VBScript you could get the hole line in Group 1 with

^(.*(your Pattern).*)$

In your Pattern you put in yours and in Group 1 you get the whole line.

Upvotes: 2

Related Questions