2012-01-23 5 views

ответ

1

Посмотрите на это или поиск с помощью Google. Не сложно интерпретировать эти регулярные выражения.

http://www.regular-expressions.info/reference.html#

Например:

\ S матчи {пробелы 2} означает, 2 из него или более

0

Почему бы не использовать DAT инструмент может 'документ' выражения? Это может помочь вам понять их.

Использование RegexBuddy (Paid однако, на мой взгляд лучший инструмент доступен) выражение документировано, как показано ниже:

// ^\s+|\s+$ 
// 
// Options:^and $ match at line breaks 
// 
// Match either the regular expression below (attempting the next alternative only if this one fails) «^\s+» 
// Assert position at the beginning of a line (at beginning of the string or after a line break character) «^» 
// Match a single character that is a “whitespace character” (spaces, tabs, and line breaks) «\s+» 
//  Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+» 
// Or match regular expression number 2 below (the entire match attempt fails if this one fails to match) «\s+$» 
// Match a single character that is a “whitespace character” (spaces, tabs, and line breaks) «\s+» 
//  Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+» 
// Assert position at the end of a line (at the end of the string or before a line break character) «$» 
Смежные вопросы