Is this possible using Regex or any other way?
Hi Chaps,
Would appreciate any assistance here as i'm "busting my nut" trying to figure this out.
I have to read a value from a SQL script which usually starts like so
[
Code:
/*****************************************************************/
DECLARE @ApplicationID VARCHAR(50), @TaskID INTEGER, @Description VARCHAR(255)
SET @ApplicationID = 'SYSTEM' SET @TaskID = 69453 SET @Description = 'Bla BLA'
I need to scan the file using the fastest possible way and get the TaskID, I have found one way to do it being
find index of @TaskID = then increment the index by 9 "TaskID =" then remove every thing preceding it
finally remove everything after 5 chars in, so I end up with string Task ='69453'
This is wildly inefficient as I have to loop this for several hundred directories.
There must be an easier way??
Re: Is this possible using Regex or any other way?
I am not a pro at regex or linQ but this is the Regex I would use:
"@TaskID = \d{5} " But it only works if the ID always is 5 numbers. And you would still have to strip down the matches. Sorry but I don't have a better solution.