MemoryRefresh!

Perl / Shorthands     Shorthands



Questions 1 Answers 0%

Pages   0 from 15
Questions   0 from 20

Reset


Backspace \b
In Perl regex, \b normaly matches a word boundary, but withing a character class it matches a backspace.
Generic whitespace \s
Many regex flavors provide a useful shorthand \s. Is a shorthand for a whole character class that matches any "whitespace character". This includes space, tab, newline, and carriage return.
Modifiers
The add i in m/../i instructs Perl to do the match in a case-insensitive manner. It's not acctualy part of the regex, but part of the m/../ syntatic packaging.
Shorthands
Among the more useful shorthand that Perl provide are: \t a tab character \n a newline character \r a carriage-return character \s any "whitespace" character (space, tab, newline) \S anything not s \w [a-zA-Z0-9_]+ match a word with w+ \W [^a-zA-Z0-9_]+ anything not w \d [0-9] a digit \D [^0-9] anything not d

Related Pages

Non-capturing
Shorthands
Search and replace
Lookaround
Text to html


0% 100%
 
 
0 pages 15 pages
1) Which one matches in Perl a word boundary?




2) Find any whitespace character







Backspace \b
In Perl regex, \b normaly matches a word boundary, but withing a character class it matches a backspace.
Generic whitespace \s
Many regex flavors provide a useful shorthand \s. Is a shorthand for a whole character class that matches any "whitespace character". This includes space, tab, newline, and carriage return.
Modifiers
The add i in m/../i instructs Perl to do the match in a case-insensitive manner. It's not acctualy part of the regex, but part of the m/../ syntatic packaging.
Shorthands
Among the more useful shorthand that Perl provide are: \t a tab character \n a newline character \r a carriage-return character \s any "whitespace" character (space, tab, newline) \S anything not s \w [a-zA-Z0-9_]+ match a word with w+ \W [^a-zA-Z0-9_]+ anything not w \d [0-9] a digit \D [^0-9] anything not d

References









Programming

Php
   
Regex
   
MySQL
   
Css
   
jQuery
   
Git
   


References