regex

regex

 英

  • 網絡正則表達式;使用正則表達式;正則表達式校驗器

例句

The mode parameter that each of the four regex functions accepts should be a string of up to three characters, out of four possible modes.

regex函數每個函數可以接受模式參數應該一個最多三個字符字符串屬于可能模式

It turns out that this smokes the regex competition when there is only a bit of whitespace on the ends of the string.

字符串末尾只有少量空格這種情況使表達陷入瘋狂工作

It should be pretty easy to construct a decent regex now that we've got the structure and special characters down.

我們了解結構特殊字符之后產生一個合適表達應該容易

The key to preventing this kind of problem is to make sure that two parts of a regex cannot match the same part of a string.

預防問題關鍵確保表達兩個部分不能字符串同一部分進行匹配

When a regex is put to use, the first step is to determine the position within the target string where the search should start.

一個表達投入使用首先確定目標字符串開始搜索位置

Each time the regex makes such a decision, it remembers the other options to return to later if necessary.

每當表達做出這樣決定如果必要的話記住另一個選項以備將來返回使用

Users of your regex will be able to easily understand and modify the pattern to meet their needs.

使用可以方便地明白修改達到他們需求

The leading and trailing slash shown in the code simply indicate the start and end of the regex.

代碼首尾表示regex開頭結尾

Because of the outer loop, the regex essentially advances right to left looking for a digit followed by three digits and a word boundary.

由于外部循環因此regex實質上向左前進查找位數一位

The Regex class contains several static methods that allow you to use a regular expression without explicitly creating a Regex object.

Regex包含若干靜態方法使無需顯式創建Regex對象即可使用表達式

Because of the outer loop, the regex essentially advances right to left looking for a digit followed by three digits and a word boundary.

由于外部循環因此regex實質上向左前進查找位數一位

The Regex class contains several static methods that allow you to use a regular expression without explicitly creating a Regex object.

Regex包含若干靜態方法使無需顯式創建Regex對象即可使用表達式

Just put the word regex in brackets ([]) before a string to create a regular expression.

需要regex括號里然后一個字符串前面可以創建正則表達式

Each time the regex finds an intermediate tag and exits a lookahead, it throws away all backtracking positions from within the lookahead.

表達每次找到一個中間標簽退出一個前瞻前瞻過程丟棄所有回溯位置

To validate such a user name, say, in a Web form submitted to your server, you might use a regex such as ^[A-Za-z].

假定提交服務器Web表格驗證這樣用戶可以使用類似^[A-Za-z]regex

We can now see that our regex has turned into a simple "program" that will be executed later.

可以看到表達已經轉化為一個稍后運行簡單程序”。

In programming, a regular expression is written in a formal language, also known as regex or regexp.

編程表達式一種形式語言編寫稱為regexregexp

The Test Rule section of the RegEx editor, which is shown in Figure 6, is used to test your rule on a set of sample text snippets.

使用RegEx編輯器TestRule部分6)示例文本片段測試規則

A new filler element contains portions of the regex that are not in a group (that is, they do not generate XML tags).

一個filler元素包含屬于部分表達生成XML標簽)。

Other switches allow you to limit indexing to only add files whose name matches a pattern (either regex or glob).

其它開關允許索引限于添加名稱模式regexglob匹配文件

This is similar to the last regex, but it replaces the lazy quantifier with a greedy one for performance reasons.

這個表達上一個出于性能原因貪婪量詞取代懶惰量詞

Some people go overboard, using regex caching schemes that aim to avoid ever compiling a given pattern and flag combination more than once.

有人過火使用表達緩存避免給定模板標記組合進行多次編譯

Consult references on those APIs for the hairy details, as they may be subtly different than the regex support in your language of choice.

參考這些API文檔獲取詳細信息不同語言之間可能存在微妙差別

That's because looping over characters to check whether they are whitespace can't match the efficiency of a regex's optimized search code.

因為循環檢查字符是不是空格效率不如表達使用優化搜索代碼

Given a regex and a datum, a regex engine yields whether the datum matches a pattern and, if a match was found, what matched.

給定一個表達數據表達引擎得到數據是否匹配模式匹配內容如果找到匹配結果

This attribute must be a regular expression that works with the Regex class.

屬性必須用于Regex正則表達式

Techniques like content-based filters (XPath or Regex) can then be used to selectively apply policies to particular messages.

然后可以使用諸如基于內容篩選XPath或者Regex之類技術以便有選擇地這些策略應用于特定消息

However, this proved too complex with long regexes (it was difficult to decide how the group elements related to the regex).

但是實踐證明對于表達這樣復雜很難確定group元素表達關系)。

Using a concise shorthand, regexes describe the form of data and decompose it.

使用簡明簡寫方式regex說明數據格式分解數據

For a full description of POSIX regular expressions see the regex man pages included in the regex directory in the PHP distribution.

POSIX表達完整描述包含PHP發行regex目錄man頁面

Techniques like content-based filters (XPath or Regex) can then be used to selectively apply policies to particular messages.

然后可以使用諸如基于內容篩選XPath或者Regex之類技術以便有選擇地這些策略應用于特定消息

However, this proved too complex with long regexes (it was difficult to decide how the group elements related to the regex).

但是實踐證明對于表達這樣復雜很難確定group元素表達關系)。

Using a concise shorthand, regexes describe the form of data and decompose it.

使用簡明簡寫方式regex說明數據格式分解數據

For a full description of POSIX regular expressions see the regex man pages included in the regex directory in the PHP distribution.

POSIX表達完整描述包含PHP發行regex目錄man頁面

The following code example creates an instance of the Regex class and defines a simple regular expression when the object is initialized.

下面代碼示例創建Regex實例初始對象定義一個簡單表達式

Indicates whether the regular expression specified in the Regex constructor finds a match in the input string.

指示Regex構造函數指定表達式輸入字符串是否找到匹配項

Here, the regex is simply , (a comma, the eponymous delimiter of a comma-separated list).

這里regex只是,(一個逗號逗號分隔列表分隔符)。

Just keep in mind that you need to use the appropriate back reference number if your regex contains more than one capturing group.

只要記住需要使用適當引用次數如果表達包含多個捕獲

If the specified mode is incorrect, any of the regex functions will return an error.

如果指定模式正確所有regex函數返回錯誤

If your input spans multiple lines, a typical regex won't suffice because scanning terminates at a newline, denoted by $.

如果輸入跨度使用典型regex不夠因為掃描$指示終止