Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Regexp::Lexer(3)      User Contributed Perl Documentation     Regexp::Lexer(3)

NAME
       Regexp::Lexer - Lexer for regular expression of perl

SYNOPSIS
	   use Regexp::Lexer qw(tokenize);
	   my $tokens =	tokenize(qr{\Ahello\s+world\z}i);

DESCRIPTION
       Regexp::Lexer is	a lexer	for regular expression of perl.

       This module splits the regular expression string	to tokens which	has
       minimum meaning.

FUNCTIONS
       o   "tokenize($re:Regexp)"

	   Tokenizes the regular expression.

	   This	function takes an argument as "Regexp",	namely it must be
	   regexp quoted variable (i.e.	"qr/SOMETHING/").  If not "Regexp"
	   argument is given, this function throws exception.

	   This	function returns the result like so;

	       {
		   tokens => [
		       {
			   char	=> '\A',
			   index => 1,
			   type	=> {
			       id => 67,
			       name => 'EscapedBeginningOfString',
			   },
		       },
		       {
			   char	=> 'h',
			   index => 2,
			   type	=> {
			       id => 1,
			       name => 'Character',
			   },
		       },
		       ...
		   ],
		   modifiers =>	['^', 'i'],
	       }

	   "tokens" is the tokens list.	Information about "type" of token is
	   located in the Regexp::Lexer::TokenType.

	   "modifiers" is the list of modifiers	of regular expression. Please
	   see also perlre.

SEE ALSO
       o   perlre

       o   perlrebackslash

       o   Regexp::Lexer::TokenType

LICENSE
       Copyright (C) moznion.

       This library is free software; you can redistribute it and/or modify it
       under the same terms as Perl itself.

AUTHOR
       moznion <moznion@gmail.com>

perl v5.24.1			  2015-02-07		      Regexp::Lexer(3)

NAME | SYNOPSIS | DESCRIPTION | FUNCTIONS | SEE ALSO | LICENSE | AUTHOR

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Regexp::Lexer&sektion=3&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help