:


      .  
           s//
m/   =~  !=  ..
         :

	i	-      .
	m	-   .
	s	-  .
	x	-   (    )

      '/x'.    
 ,    (?...)

    (pattern)      regexp
  .      
  V8   (Henry Spencer)  
   .

     ( 
  )   egrep - :

	\	-      .
	^	-  
	.	-   .  '\n' -  .
	$	-  
	|	-  ()
	()	- 
	[]	-  

   (  ):

	*	-  0    
	+	-  1    
	?	- 1  0 
	{n}	-  n 
	{n,}	-    
	{n,m}	-   n,     m

        ()
.   '*'  {0,} , '+' - {1,}
 '?' - {0,1}. n  m     65536.

    "" (greedy). 
       
  .    "  "
   '?'.     
  .  :

	*?	-  0  
	+?	- 1  
	??	- 0  1 
	{n}?	-  n 
	{n,}?	-   n 
	{n,m}?	-    n   m 

           
 `\` -  (-):

	\t	-  
	\n	-  
	\r	-  
	\A	-  
	\v	-  
	\a	- 
	\e	- escape
	\033	-   
	\x1A	- 
	\c[	- control 
	\l	-    
	\u	-   -//-
	\L	-       \E
	\U	-   -//-
	\E	-   
	\Q	-    

     :

	\w	- -  '_' 
	\W	-  -  '_' 
	\s	-  
	\S	-   
	\d	-  
	\D	-   

     "" .   
 . :

	\w+	- 
	\d+	-  
	[+-]?\d+	-   
	[+-]?\d+\.?\d*	-   

    .   
    .  :

	\b	-  
	\B	-   
	\A	-  
	\Z	-  
	\G	-   m//g

  (\b) -      \w  \W.
   '\b'   backspace ().
 \A  \Z -  '^'  '$'    '^'
   '$'       
 \A  \Z       .

     ( )
      '\'.
           
 '$'.     :

	$+	-   
	$&	-  
	$`	-   
	$'	-   

:

$s = " 1  2   3";
if ($s =~ /(\d+)\D+(\d+)/)
    {
        print "$1\n";	#  '1'
        print "$2\n";	# '2'
        print "$+\n";	# '2'
        print "$&\n";	# '1  2'
        print "$`\n";	# ' '
        print "$'\n";	# '   3'
   }




(?#)	-    .

	(?:)	-    '( )'    

	(?=)	- "" .  /\w+(?=\t)/
			     
  '\t'    .

:
$s = "1+2-3*4";
if ($s =~ /(\d)(?=-)/)  #      '-'
    {
        print "$1\n";   #  '2'
   }
else { print " \n";}


	(?!)	- ""   .

:
$s = "1+2-3*4";
if ($s =~ /(\d)(?!\+)/) #       '+'
    {
        print "$1\n";   #  '2'
   }
else { print " \n";}


	(?ismx)	- "" .    
	      .




	1.         .
	       
	  '\'.
	2.      .

	3.    ()   
	 '[]'         
	    .     
	 '^' -        
	    .    
	 '-'   .  a-z
	     , 0-9 -   ..

	4.  ,     
	 '\'    .

	5.     '|'
	       .

	6.      ""
	          '\'
	    '\1'.


Last-modified: Sat, 08 Aug 1998 05:51:08 GMT
: