Create Regex by Description

Generates Regex pattern based on given description.

Input

Create a precise Regular Expression (regex) pattern based on a provided description. The model allows you to specify the Regex Type or Programming Language to ensure compatibility and accuracy.

[1.0.0]:
First Version
VersionAI ModelCreatedLink
1.0.005.05.2023

API

The REST API allows you to call the tool with the same costs as when running the tool. Please generate an Personal access token before using the REST API.

Parameters

  • requirement (Requirement): The requirement the regex should have
  • type (Regex Type / Programming Language): The regex type or programming language you want to use the regex in.
  • Call the REST API by cURL
    curl -v -H "Authorization: Bearer PERSONAL_ACCESS_TOKEN" https://api.anysolve.ai/rest/v1/u-ba835df8268fc301-create-regex-by-description/1.0.0?requirement=allow%20up%20to%203%20chars%20and%20numbers%20and%20then%20*&type=PCRE
  • Install the package with pip
    python3 -m pip install anysolve
  • Run in python3
    import os
    from anysolve import AnySolve
    anysolve_token = os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN') # Resolve your personal access token here
    client = AnySolve(anysolve_token)
    res = client.run('u-ba835df8268fc301-create-regex-by-description','1.0.0', {'requirement': 'allow up to 3 chars and numbers and then *', 'type': 'PCRE'})
    print(res)
  • Coming soon: Within AnySolve ChatComplete prompts you can use the following command to execute the task:
    /run('u-ba835df8268fc301-create-regex-by-description','1.0.0', requirement='allow up to 3 chars and numbers and then *', type='PCRE')