Chuyển đến nội dung chính

Bài đăng

Đang hiển thị bài đăng từ tháng mười, 2020

javascript regex to find image urls in string text

There are three issues with your attempt: boundaries of your matches, using '.*' and missing pattern for legal postfix.The dot star notation is a bad idea in RegEx, which the article "Death to Dot Star!" illustrates quite well. Use negated character classes instead, and here I chose "\S*?" which is "any character that is not a whitespace". If you try replacing that with ".*?" instead on regex101, you can see it failing to match properly (it includes a link that is not an image).
Since it is all in the same string, boundries must be defined for the match, and since whitespace is sufficient "\b" does the trick nicely. This also removes the need for the "(.*)" and "(\w|$)" parts.The last thing you missed was the legal endings to the url, and there are two solutions to this: Either define what you think is plausible to include most scenarios and have no false positives, or include anything but have a chance of ge…

Tính swap cho Linux ( swap space calculator linux )

Tôi nên dùng  swap size bao nhiêu ? Có nên gấp đôi số RAM hay bằng nửa RAM ? Server tôi nhiều RAM có cần đến swap không ? Dựa vào bảng tham khảo sau 
RAM SizeSwap size < 1GB = RAM Size hoặc gấp đôi RAM Size
 > 2GB = RAM Size + 2GBSiêu to khổng lồ  không cần