perl程序设计技巧
1. Why does POE pass parameters as array slices? http://poe.perl.org/?POE_FAQ/calling_convention 2. perl regular expression fast referecnces metacharacters are {}[]() ^ $ . | * + ? a metacharacter can be matched by putting a backslash befo
1. Why does POE pass parameters as array slices?
http://poe.perl.org/?POE_FAQ/calling_convention
2. perl regular expression fast referecnces
metacharacters are
{ } [ ] ( ) ^ $ . | * + ?
a metacharacter can be matched by putting a backslash before it
anchor metacharacters ^ and $ .
The anchor ^ means match at the beginning of the string and the anchor $ means match at the end of the string, or before a newline at the end of the string.
"housekeeper" =~ /keeper/; # matches
"housekeeper" =~ /^keeper/; # doesn't match
"housekeeper" =~ /keeper$/; # matches
"housekeeper " =~ /keeper$/; # matches
/cat/; #matches 'cat'
/[bcr]at/; #matches 'bat', 'cat', or 'rat'
/item[0123456789]/; #matches 'item0' or ... or 'item9'
"abc" =~ /[cab]/; #matches 'a'
/[yY][eE][sS]/ can be rewritten as /yes/i.
The special characters for a character class are - ] / ^ $ (and the pattern delimiter, whatever it is). ] is special because it denotes the end of a character class. $ is special because it denotes a scalar variable. / is special because it is used in escape sequences.
/[/]c]def/; # matches ']def' or 'cdef'
$x = 'bcr';
/[$x]at/; # matches 'bat', 'cat', or 'rat'
/[/$x]at/; # matches '$at' or 'xat'
/[//$x]at/; # matches '/at', 'bat, 'cat', or 'rat'
/item[0-9]/; # matches 'item0' or ... or 'item9'
/[0-9bx-z]aa/; # matches '0aa', ..., '9aa',
# 'baa', 'xaa', 'yaa', or 'zaa'
/[0-9a-fA-F]/; # matches a hexadecimal digit
/[0-9a-zA-Z_]/; # matches a "word" character, # like those in a Perl variable name
The special character ^ in the first position of a character class denotes a negated character class, which matches any characters but those in the brackets.
/[^a]at/; # doesn't match 'aat' or 'at', but matches
# all other 'bat', 'cat, '0at', '%at', etc.
/[^0-9]/; # matches a non-numeric character
/[a^]at/; # matches 'aat' or '^at'; here '^' is ordinary
/d matches a digit, not just [0-9] but also digits from non-roman scripts
/s matches a whitespace character, the set [/ /t/r/n/f] and others
/w matches a word character (alphanumeric or _), not just [0-9a-zA-Z_] but also digits and
characters from non-roman scripts
/D is a negated /d; it represents any other character than a digit, or [^/d]
/S is a negated /s; it represents any non-whitespace character [^/s]
/W is a negated /w; it represents any non-word character [^/w]
The period '.' matches any character but "/n" (unless the modifier //s is in effect, as explained
below).
//d/d:/d/d:/d/d/; # matches a hh:mm:ss time format
/[/d/s]/; # matches any digit or whitespace character
//w/W/w/; # matches a word char, followed by a
# non-word char, followed by a word char
/..rt/; # matches any two chars, followed by 'rt'
/end/./; # matches 'end.'
/end[.]/; # same thing, matches 'end.'
regexp dog|cat. As before, Perl will try to match the regexp at the earliest possible point in the
string. At each character position, Perl will first try to match the first alternative, dog. If dog doesn't
match, Perl will then try the next alternative, cat. If cat doesn't match either, then the match fails and
Perl moves to the next position in the string.
"cats and dogs" =~ /cat|dog|bird/; # matches "cat"
"cats and dogs" =~ /dog|cat|bird/; # matches "cat"
/(a|b)b/; # matches 'ab' or 'bb'
/(ac|b)b/; # matches 'acb' or 'bb'
/(^a|b)c/; # matches 'ac' at start of string or 'bc' anywhere
/(a|[bc])d/; # matches 'ad', 'bd', or 'cd'
/house(cat|)/; # matches either 'housecat' or 'house'
/house(cat(s|)|)/; # matches either 'housecats' or 'housecat' or
# 'house'. Note groups can be nested.
/(19|20|)/d/d/; # match years 19xx, 20xx, or the Y2K problem, xx
"20" =~ /(19|20|)/d/d/; # matches the null alternative '()dd',
# because '20dd' can't match

ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

AI Hentai Generator
AIヘンタイを無料で生成します。

人気の記事

ホットツール

メモ帳++7.3.1
使いやすく無料のコードエディター

SublimeText3 中国語版
中国語版、とても使いやすい

ゼンドスタジオ 13.0.1
強力な PHP 統合開発環境

ドリームウィーバー CS6
ビジュアル Web 開発ツール

SublimeText3 Mac版
神レベルのコード編集ソフト(SublimeText3)

ホットトピック









Win11 のヒントの共有: Microsoft アカウントのログインをスキップする 1 つのトリック Windows 11 は、新しいデザイン スタイルと多くの実用的な機能を備えた、Microsoft によって発売された最新のオペレーティング システムです。ただし、一部のユーザーにとっては、システムを起動するたびに Microsoft アカウントにログインしなければならないのが少し煩わしい場合があります。あなたがそのような人であれば、次のヒントを試してみるとよいでしょう。これにより、Microsoft アカウントでのログインをスキップして、デスクトップ インターフェイスに直接入ることができるようになります。まず、Microsoft アカウントの代わりにログインするためのローカル アカウントをシステムに作成する必要があります。これを行う利点は、

C 言語では、他の変数のアドレスを格納するポインタを表し、& は変数のメモリ アドレスを返すアドレス演算子を表します。ポインタの使用に関するヒントには、ポインタの定義、ポインタの逆参照、ポインタが有効なアドレスを指していることの確認が含まれます。アドレス演算子の使用に関するヒントには、変数アドレスの取得、配列要素のアドレスを取得するときに配列の最初の要素のアドレスを返すことなどが含まれます。 。ポインター演算子とアドレス演算子を使用して文字列を反転する実際の例。

私たちは Excel で表を作成したり編集したりすることがよくありますが、ソフトウェアに触れたばかりの初心者にとって、Excel を使用して表を作成する方法は私たちほど簡単ではありません。以下では、初心者、つまり初心者がマスターする必要があるテーブル作成のいくつかの手順について演習を行います。初心者向けのサンプルフォームを以下に示します。入力方法を見てみましょう。 1. Excel ドキュメントを新規作成するには 2 つの方法があります。 [デスクトップ]-[新規作成]-[xls]ファイル上の何もない場所でマウスを右クリックします。 [スタート]-[すべてのプログラム]-[Microsoft Office]-[Microsoft Excel 20**] を実行することもできます。 2. 新しい ex ファイルをダブルクリックします。

VSCode (Visual Studio Code) は、Microsoft によって開発されたオープン ソース コード エディターであり、強力な機能と豊富なプラグイン サポートを備えており、開発者にとって推奨されるツールの 1 つです。この記事では、初心者が VSCode の使用スキルをすぐに習得できるようにするための入門ガイドを提供します。この記事では、VSCode のインストール方法、基本的な編集操作、ショートカット キー、プラグインのインストールなどを紹介し、具体的なコード例を読者に提供します。 1. まず VSCode をインストールします。

Win11 のトリックが明らかに: Microsoft アカウントのログインをバイパスする方法 最近、Microsoft は新しいオペレーティング システム Windows11 を発表し、広く注目を集めています。以前のバージョンと比較して、Windows 11 はインターフェイスのデザインや機能の改善の点で多くの新しい調整を加えましたが、いくつかの議論も引き起こしました. 最も目を引く点は、ユーザーが Microsoft アカウントでシステムにログインすることを強制することです。ユーザーによっては、ローカル アカウントでログインすることに慣れており、個人情報を Microsoft アカウントにバインドすることに抵抗がある場合があります。

タイトル: PHP プログラミングのヒント: 3 秒以内に Web ページにジャンプする方法 Web 開発では、一定時間内に別のページに自動的にジャンプする必要がある状況によく遭遇します。この記事では、PHP を使用して 3 秒以内にページにジャンプするプログラミング手法を実装する方法と、具体的なコード例を紹介します。まず、ページ ジャンプの基本原理は、HTTP 応答ヘッダーの Location フィールドを通じて実現されます。このフィールドを設定すると、ブラウザは指定されたページに自動的にジャンプできます。以下は、P の使用方法を示す簡単な例です。

XGPでの『Diablo 4』と『Path of Exile』の発売に伴い、多くの新情報が公開されました。 3 月の最終週には、ディアブロのようなゲームのユーザーを獲得するための新たな戦いが見られるでしょう。まずは発売から1年が経ち、愛されたり嫌われたりしている『ディアブロ 4』についてお話しましょう。半年前から予告されていたレイトレーシング機能が、いよいよ3月26日に正式にゲームに追加される。新しいレイ トレーシング エフェクトは、鎧、水、窓、その他の反射面でのレイ トレーシングによる反射や、レイ トレーシングによるシャドウなど、さまざまな視覚的な強化をもたらします。ただし、ライト トレース特殊効果にはグラフィック カード リソースに対する高い要件があるため、コンピューターの構成が対応する標準を満たしていない場合、ゲームをスムーズに実行することが困難になる可能性があります。 3 月 28 日、「ディアブロ 4」が正式に Ga に参加します

フォームは、Web サイトまたはアプリケーションの作成に不可欠な部分です。 Laravel は人気のある PHP フレームワークとして、豊富で強力なフォーム クラスを提供し、フォーム処理をより簡単かつ効率的にします。この記事では、Laravel フォームクラスを使用して開発効率を向上させるためのヒントをいくつか紹介します。以下、具体的なコード例を挙げて詳しく説明します。フォームの作成 Laravel でフォームを作成するには、まずビューに対応する HTML フォームを記述する必要があります。フォームを操作するときは、Laravel を使用できます
