V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  phpfpm  ›  全部回复第 1 页 / 共 26 页
回复总数  516
1  2  3  4  5  6  7  8  9  10 ... 26  
@ZE3kr 但是为啥这个例子 php 和 go 没踩坑呢,js ,.net ,python 都挂了
@rrfeng php 石宪的应该是 pcre
@sunfall
@ghjh
感谢,get ,学习了。
例如,正则表达式模式或量词^(a+)+$由以下 NFA 表示

收。
@yumusb 主要是这个现象无法描述,搜索引擎对于*支持的很差

我试了搜索 star after capture group 也没找到合适的结果

但是至少 ff 给你说 too much 了 hhh
```
package main

import (
"fmt"
"regexp"
"strings"
"time"
)

func testRegexPerformance(repeatCount int) {
testString := strings.Repeat("a", repeatCount) + "#"
regex := regexp.MustCompile(`(\w*)*$`)

startTime := time.Now()
result := regex.MatchString(testString)
endTime := time.Now()
executionTime := endTime.Sub(startTime).Milliseconds()

fmt.Println("Repeat Count:", repeatCount)
fmt.Println("Execution Time:", executionTime, "milliseconds")
fmt.Println("-----------------------------------")
fmt.Println(result)
}

func main() {
// 测试从 1 到 50 的重复次数
for i := 1; i <= 50; i++ {
testRegexPerformance(i)
}
}
```

```
function testRegexPerformance(repeatCount) {
var testString = 'a'.repeat(repeatCount) + '#';
var regex = /(\w*)*$/;

var startTime = process.hrtime();
var result = regex.test(testString);
var endTime = process.hrtime(startTime);
var executionTime = endTime[0] * 1000 + endTime[1] / 1000000;

console.log("Repeat Count:", repeatCount);
console.log("Execution Time:", executionTime + " milliseconds");
console.log("-----------------------------------" + result);
}

// 测试从 1 到 50 的重复次数
for (var i = 1; i <= 50; i++) {
testRegexPerformance(i);
}
```
<?php

function testRegexPerformance($repeatCount) {
$testString = str_repeat('a', $repeatCount) . '#';
$regex = '/(\w*)*$/';

$startTime = microtime(true);
$result = preg_match($regex, $testString);
$endTime = microtime(true);
$executionTime = ($endTime - $startTime) * 1000;

echo "Repeat Count: $repeatCount\n";
echo "Execution Time: $executionTime milliseconds\n";
echo "-----------------------------------\n";
var_dump($result);
}

// 测试从 1 到 50 的重复次数
for ($i = 1; $i <= 50; $i++) {
testRegexPerformance($i);
}
```

```
import re
import time

def test_regex_performance(repeat_count):
test_string = 'a' * repeat_count + '#'
regex = r'(\w*)*$'

start_time = time.time()
result = re.match(regex, test_string)
end_time = time.time()
execution_time = (end_time - start_time) * 1000

print("Repeat Count:", repeat_count)
print("Execution Time:", execution_time, "milliseconds")
print("-----------------------------------")
print(result)

# 测试从 1 到 50 的重复次数
for i in range(1, 51):
test_regex_performance(i)
```
这问题一点也不有趣
能上全闪还是全闪吧。。。别替老板省钱
71 天前
回复了 well775397252 创建的主题 PHP 求指点 PHP 内存泄露排查
你们一个月不上线?
74 天前
回复了 molika 创建的主题 宽带症候群 老家的网络突然很多网站打不开
你能具体说说么,发一下 curl 和 traceroute

不要只凭感觉发泄情绪

据我所知宽带差一点也不会出现你说的这么差。。。

盲估开启了 ipv6 导致 dns 不对之类的问题
保留现场,闪退,避免带来更多问题
个人显然不会觉得 2w 对于一个生计来说是贵的,只是说不适合你。。
@mohumohu
1 捡来的设备找不到技术支持,当然厚点脸皮也不是不行
2 主要是将来换路由的时候直接改三层的下一跳就行,别的不用改。。。
屠龙的勇士终将成龙
我一点也没看出来你的技术热情,而且你还不尊重技术同学。学做事儿先做人,谢谢
试用了,没啥用
@Wenpo 我觉得整体向好
@flynaj 猫棒我可以加额外散热,而且连接数真的可以秒杀光猫。

@RecursiveG 协议分流和做主路由并不能打
@nkloveni 有点丑。。。
@kkk9 对我就是机柜……
@Satansickle 有点丑,&& 我是多线负载多了一个莫名其妙的 wan 口就很奇怪


感谢 1~5 楼的回复,看起来确实不是我不会用的问题。
155 天前
回复了 dreamn 创建的主题 Linux 求推荐自组装 Linux 主机
你要不要捡垃圾,价格可以低到怀疑人生。。

R620 ,预算 double 可以上 R730
证书是如何签发的?是不是基于 http 的证书鉴权都不够安全了?
1  2  3  4  5  6  7  8  9  10 ... 26  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3065 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 34ms · UTC 10:59 · PVG 18:59 · LAX 03:59 · JFK 06:59
Developed with CodeLauncher
♥ Do have faith in what you're doing.