Quote:
Originally Posted by fysiks
RegEx was designed for flexibility. If you need flexibility, use RegEx. If you want to check for a static IP and port, use a string compare.
A RegEx pattern for IP and port won't likely cause any significant performance issues. In fact, it may be more efficient than other methods if you have more than a handful of static IPs to check. Just remember to precompile the pattern.
|
I got drop fps every
say message, i use pattern found on this forums!
Code:
#define PATTERN "(?:(?:2\s*5\s*[0-5]|2\s*[0-4]\s*[0-9]|1\s*[0-9]\s*[0-9]|[1-9]?\s*[0-9])\s*\.\s*){3}(?:2\s*5\s*[0-5]|2\s*[0-4]\s*[0-9]|1\s*[0-9]\s*[0-9]|[1-9]?\s*[0-9])"
Maybe this pattern is bad ? This pattern \d+\.\d+\.\d+\.\d+:\d+ can work, too?
I test join player/say message. And every player join - fps drop from 1000 to 900 (for example, 100 ms sleep), every
say message, too.