运行 ❯
获取您自己的
PHP
服务器
×
更改方向
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <h1>Regex Modifier: [e-o]</h1> <p>How many letters in the text "Welcome" are alphabetically between "e" and "o":</p> <?php $txt = "Welcome"; $pattern = "/[e-o]/"; echo preg_match_all($pattern, $txt); ?> <p>The matches were found here:</p> <?php echo preg_replace($pattern, "#", $txt); ?> <p>(Each match was replaced by a # character)</p> </body> </html>
正则表达式修改器: [e-o]
文本 "Welcome" 中有多少个字母在字母表上位于 "e" 和 "o" 之间?
5
匹配项在此处找到
W##c###
(每个匹配项都替换为 # 字符)