We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Java Pattern, I used to have something like this:
public String getAttributeFromMessage(String receiveData, Pattern patternToSearch) { Matcher matcher = patternToSearch.matcher(receiveData); if (matcher.find()) { return matcher.group(1); } return ""; }
Using this library I did something like this:
String[] patterns = new String[]{ "\"field1\":\\s*\"(.*?)\"", "\"field2\":\\s*(\\d+)(\\.\\d)?", "\"field3\":\\s*\"(.*?)\"" }; this.matcher = MultiPattern.of(patterns).matcher(); ... public String getAttributeFromMessage(String receiveData) { int[] match = this.matcher.match(receiveData); ?? }
I'm not sure how I can extract the values that the matcher has found, using Java.pattern I could do matcher.group(1) to get the string.
Any idea?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Using Java Pattern, I used to have something like this:
Using this library I did something like this:
I'm not sure how I can extract the values that the matcher has found, using Java.pattern I could do matcher.group(1) to get the string.
Any idea?
The text was updated successfully, but these errors were encountered: