GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Regexp::Lexer(3) User Contributed Perl Documentation Regexp::Lexer(3)

Regexp::Lexer - Lexer for regular expression of perl

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

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

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

"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.

  • perlre
  • perlrebackslash
  • Regexp::Lexer::TokenType

Copyright (C) moznion.

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

moznion <moznion@gmail.com>
2015-02-07 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.