Was this page helpful?

String.Matches

    Table of contents
    1. 1. Usage Restrictions
    2. 2. Parameters
    3. 3. Result
    4. 4. Samples
    string.Matches(text : str, pattern : str) : list

    Match a string against a .NET regular expression pattern and return all captured parts.

    Usage Restrictions

    1.9.0b or later

    Parameters

    Name Type Description
    text
    str The string value.
    pattern
    str The regular expression pattern.

     

    Result

    All the captured string values that match the regular expression, in a list.

     

    Samples


    Output

    To return a list of characters that match the pattern:

    {{ string.matches("aba cad abra", "(a|b|r)+") }} 

     

    [ "aba", "a", "abra" ]
    Was this page helpful?
    Tag page
    Viewing 1 of 1 comments: view all
    The output in the sample isn't what i'm getting... I got this [ "a", "b", "a" ]
    Posted 22:48, 28 Aug 2011
    Viewing 1 of 1 comments: view all
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by