c# - Searching and Extracting substring recursively with RegEx -
i'm wondering if there regex pattern solve problem.
i'm getting strings like: "running script a23jddie392.sql", "skipped script ew223.sql", "script 2234ffss321.sql has error" , on.
is possible extract scriptname regex? maybe searching .sql , going recursively first blank before scriptname?
thank you!
here code:
var pattern = "\\s\\w+[.]sql"; var test = "script 2234ffss321.sql has error"; var match = regex.match(test, pattern); if (match.success) { console.writeline(match.groups[0].value); }
Comments
Post a Comment