I tried changing this:
^\D*(\d+)\D*$
To this:
$1
And crash
Crash using this Regex: ^D*(d+)D*$
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Crash using this Regex: ^D*(d+)D*$
Last edited by kengrubb on Tue Aug 10, 2021 8:32 pm, edited 1 time in total.
(2[Bb]|[^2].|.[^Bb])
That is the question.
That is the question.
Here is a sample of the text. SQL Server Message Results, and I was trying to get just the numbers to add them up [by then copy and pasting into Excel].
(1000 rows affected)
(1000 rows affected)
(1000 rows affected)
(1000 rows affected)
(1000 rows affected)
(1000 rows affected)
(1000 rows affected)
(1000 rows affected)
(1000 rows affected)
(1000 rows affected)
(1000 rows affected)
(1000 rows affected)
(1000 rows affected)
(1000 rows affected)
(1000 rows affected)
(1000 rows affected)
(2[Bb]|[^2].|.[^Bb])
That is the question.
That is the question.
I bet that is not the regex you wanted to post, because without the backslashes you surely are unable to get numbers. See This phpBB installation falls apart.
Your regex might match its result itself (think about it: you remove potential leading and trailing non-numbers, to then have a clean number left - but that's also something that matches what you search for). Why not matching something that won't catch the outcome again? I.e. to then replace that by $1?
Your regex might match its result itself (think about it: you remove potential leading and trailing non-numbers, to then have a clean number left - but that's also something that matches what you search for). Why not matching something that won't catch the outcome again? I.e.
Code: Select all
^\((\d+) rows.+$
Yours works, but I'm puzzled why mine blew up TP. I tried it in Expresso, and it understood it. Tried it in another tool, and it worked fine.AmigoJack wrote:I bet that is not the regex you wanted to post, because without the backslashes you surely are unable to get numbers.
Update: Now I'm seeing that it stripped the backslashes when I posted.
(2[Bb]|[^2].|.[^Bb])
That is the question.
That is the question.