This section will guide you on how to perform your first call to the RegexSolver API. To use the following steps, you need to have already obtained a valid API token. You will use this token to authenticate your API requests.
By setting up an environment variable called $REGEX_SOLVER_API_TOKEN containing your API token you can call the above cURL command to get the details of the regex pattern [A-Z][a-z]{1,4}.
If your API token is valid and correctly set up, the command should return the following JSON structure:
import com.regexsolver.api.RegexSolver;
import com.regexsolver.api.Term;
import com.regexsolver.api.exception.ApiError;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException, ApiError {
RegexSolver.initialize(/* Your API token here -> */"");
Term regex = Term.regex("[A-Z][a-z]{1,4}");
Details details = regex.getDetails();
System.out.println(details);
}
}
You need first to initialize the API wrapper with RegexSolver.initialize(String), it will ensure that the subsequent API calls are authenticated.
Then to get the details of the regex pattern [A-Z][a-z]{1,4}, you need to create a term with Term.Regex and call on it getDetails(). It performs an API call synchronously and returns the result as a Details instance.
If your API token is valid and correctly set up, the execution should print the following information:
import { RegexSolver, Term } from "regexsolver";
RegexSolver.initialize("YOUR TOKEN HERE");
const term = Term.regex("[A-Z][a-z]{1,4}");
term.getDetails().then(details => {
console.log(details.toString());
});
You need first to initialize the API wrapper with RegexSolver.initialize(String), it will ensure that the subsequent API calls are authenticated.
Then to get the details of the regex pattern [A-Z][a-z]{1,4}, you need to create a term with Term.regex and call on it getDetails(). It performs an API call and returns the result as a Details instance.
If your API token is valid and correctly set up, the execution should print the following information:
from regexsolver import RegexSolver, Term
RegexSolver.initialize("YOUR TOKEN HERE")
regex = Term.regex(r"[A-Z][a-z]{1,4}")
details = regex.get_details()
print(details)
You need first to initialize the API wrapper with RegexSolver.initialize(String), it will ensure that the subsequent API calls are authenticated.
Then to get the details of the regex pattern [A-Z][a-z]{1,4}, you need to create a term with Term.regex and call on it get_details(). It performs an API call synchronously and returns the result as a Details instance.
If your API token is valid and correctly set up, the execution should print the following information: