"(?s).*(ST\\*214|ST\\*210).*"
In Java you need to enable DOTALL mode (to make . match with line terminators too). This can be done by including (?s) modifier. You had match only in this ST*214*900063730~ particular part of first string.
More Related Contents:
- Java Variable Substitution
- Counting the occurrence of a special character, numbers and letters on a user-specified string
- Extract Substrings using regex Java [closed]
- Remove HTML tags from a String
- Java – escape string to prevent SQL injection
- Regex for splitting a string using space when not surrounded by single or double quotes
- Java string split with “.” (dot) [duplicate]
- String.replaceAll(regex) makes the same replacement twice
- Rationale for Matcher throwing IllegalStateException when no ‘matching’ method is called
- Is it possible to match nested brackets with a regex without using recursion or balancing groups?
- Escaping special characters in Java Regular Expressions
- java regular expression to extract content within square brackets
- Java regex for support Unicode?
- What is the use of Pattern.quote method?
- Java: Split string when an uppercase letter is found
- How to escape comma and double quote at same time for CSV file?
- Tokenizing Error: java.util.regex.PatternSyntaxException, dangling metacharacter ‘*’
- How to Split a mathematical expression on operators as delimiters, while keeping them in the result?
- removing characters of a specific unicode range from a string
- Use Java and RegEx to convert casing in a string
- Regex that Will Match a Java Method Declaration
- RegEx in Java: how to deal with newline
- Set minimum and maximum characters in a regular expression
- Pattern to extract text between parenthesis
- Java Regex Illegal Escape Character in Character Class
- Regex search with pattern containing (?:.|\s)*? takes increasingly long time
- How can split a string which contains only delimiter?
- Regular expression to get an attribute from HTML tag
- Issue with Java Regex \b
- Java’s Scanner vs String.split() vs StringTokenizer; which should I use?