Find numbers after specific text in a string with RegEx -
i have multiline string following:
2012-15-08 07:04 bla bla bla blup 2012-15-08 07:05 *** error importing row no. 5: import of line failed because bla bla 2012-15-08 07:05 text don't want search... 2012-15-08 07:06 text don't want search... 2012-15-08 07:06 *** error importing row no. 5: import of line failed because bla bla 2012-15-08 07:07 import has finished bla bla
what want extract row numbers have errors of regularexpression (with powershell). need find number between "*** error importing row no. " , following ":" give me row number.
i looked @ various other regex question honest answers chinese me.
tried built regex of http://regexr.com/ haven't been successful far, example following pattern:
"error importing row no. "(.?)":"
any hints?
try expression:
"error importing row no\. (\d+):"
here need understand quantifiers , escaped sequences:
.
character; want numbers, use\d
; if meant period character must escape backslash (\.
)?
0 or 1 character; isn't want, can here error on line 10 , take "1"+
1 or many; suffice us*
character count; must take care when using.*
can consume entire input
Comments
Post a Comment