Pattern 1 « Pattern « Java Regex Q&A

Home
Java Regex Q&A
1.Development
2.find
3.group
4.Match
5.matcher
6.number
7.Operation
8.parse
9.Pattern
10.replace
11.validation
12.word
Java Regex Q&A » Pattern » Pattern 1 

1. two regex patterns, can they be one?    stackoverflow.com

I have two regular expressions that I use to validate Colorado driver's license formats.

[0-9]{2}[-][0-9]{3}[-][0-9]{4}
and
[0-9]{9}
We have to allow for only 9 digits but the user is free to enter it in ...

2. What is the proper way of inserting a pipe into a Java Pattern expression?    stackoverflow.com

What is the proper way of inserting a pipe into a Java Pattern expression? I actually want to use a pipe as a delimiter and not the or operator. I.E:

"hello|world".split("|"); --> {"hello", "world"}
...

3. Pattern Error while using RegEx in Java    stackoverflow.com

I am stuck up with a problem while using Regular Expression. My requirement is : split a long string into maximum size of 125 letters and then insert a line break in ...

4. No digits Java Regex Pattern    stackoverflow.com

hi I want a regex pattern to check that the string doesn't contain any digits . For Illustration : I'm coding a Hospital System and I want from user to enter the name ...

5. regex to get weight    stackoverflow.com

I have html that has the weight of a item.

<div><b>Item Weight  (0.51 lbs in Warehouse 3)</b></div>
I need a regex to get the weight and unit of measure. So in the above ...

6. Translate XML Schema pattern to Java regular expression    stackoverflow.com

Who can help me to translate this XML Schema pattern "[0-9]+-([0-9]|K)" to java regular expression?

7. can we check multiple patterns using regex in java?    stackoverflow.com

i want to check 2 patterns using regex. can i check those both patterns in the same time (like if(condition1 | condition2) condition). any idea?

8. Refactor Regex Pattern - Java    stackoverflow.com

I have the following aaaa_bb_cc string to match and written a regex pattern like \\w{4}+\\_\\w{2}\\_\\w{2} and it works. Is there any simple regex which can do this same ?

9. pattern for the following condition in java    stackoverflow.com

i want to know how to write pattern.. for example : the word is

   "AboutGoogle AdWords Drive traffic and customers to your site. Pay through Cheque,    ...

10. Why doesn't ? work as an optional repetition specifier in this pattern?    stackoverflow.com

I am trying to match inputs like

<foo>
<bar>
#####<foo>
#####<bar>
I tried #{5}?<\w+>, but it does not match <foo> and <bar>. What's wrong with this pattern, and how can it be fixed?

11. name pattern regex    stackoverflow.com

I wanted to get a regex pattern for name where i m using for validation purpose.The pattern which i m using now is having some problem.The problem is if i give ...

12. pattern Recognizer in java    stackoverflow.com

I'm writing a file renamer program in java. The issue is when giving input pattern. When the input is complex like (][) in that case, I'm getting errors by java.util.regex.Pattern class.. The major ...

13. regex for java SimpleDateFormat pattern (problem could be specific for birth)    stackoverflow.com

What is a good regex fo java SimpleDateFormat pattern ? Story: I have problem with setting eclipse birth date format patter with DateTimeFormatValue, no exceptions(feedback form QA only). So, the eclipse birt by ...

14. Another Java RegEx question    stackoverflow.com

I have the following code:

public static void main(String[] args){
    StringBuilder content = new StringBuilder("abcd efg h i. -  – jk(lmn) qq zz.");
    String patternSource ...

15. ANT attribute in regex pattern    stackoverflow.com

I'm writing an utility macro wich involves checking whether a comma-separated list list contains or not a particular value value.

<macrodef name="csvcontains">
    <attribute name="value"/>
    <attribute name="list"/>
 ...

16. How to create a negated charclass pattern?    stackoverflow.com

I need a method taking a pattern as an argument and returning the negated pattern. The input pattern is always a charclass (otherwise it'd impossible). The straightforward attempt

public Pattern negate(Pattern p) ...

17. Get repeating pattern using regex    stackoverflow.com

If I have this input string: {post:[matt]} and I want to get the string where "matt" currently is, I'd use this:

Pattern pattern = Pattern.compile("^\\{(.+):[(.+)]\\}$")
Matcher matcher = pattern.matcher("{post:[matt]}");
    if(matcher.matches()) {
 ...

18. Java Pattern New Line Problem    stackoverflow.com

In reading the documentation for Pattern, it declares \s as a whitespace character: [ \t\n\x0B\f\r]. So why does the second scanner below return null, and how can I get the ...

19. Pattern Troubles    stackoverflow.com

I have a Java pattern I would like to match. I want to take my initial pattern an match the first occurrence of it. However, I consider

public static ...

20. Java regex always fails    stackoverflow.com

I have a Java regex pattern and a sentence I'd like to completely match, but for some sentencecs it erroneously fails. Why is this? (for simplicity, I won't use my complex ...

21. Regex pattern classification for Java?    stackoverflow.com

For example, I want to classify c*t => CLASS1, and d*g => CLASS2:

Pattern CXT = Pattern.compile("^c.*t$");
Pattern DXG = Pattern.compile("^d.*g$");

public int classify(String in) {
    if (CXT.matches(in)) return CLASS1;
  ...

22. Regular Expression to a Java.regex.Pattern    stackoverflow.com

I'm working with the IPV6 address space to have our java app accept the IPV6 standard. I've written a regular expression that is tested and working.

((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}((:[0-9A-Fa-f]{1,4}){1,2}|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)|(([0-9A-Fa-f]{1,4}:){3}|(((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4] 

23. What will be the Regex for my required pattern    stackoverflow.com

I have a pattern like -

public static void myMethod(int Val , String Val){}
so public\static\void\myMethod(int\sVal\s,\sString\sVal) but if my method have more space than one like public ...

24. Regex pattern in java    stackoverflow.com

What would be a regex pattern for the following ' and ® in Java. I have tried the following but have not been successful

  1. &#[0-1][0-1][0-1]
  2. &#\d\d

25. Regex: skip first occurence of pattern    stackoverflow.com

Let's say I have a String, foo, with values separated by whitespace:

  • [value 1] [value 2] [value 3] ... [value n]
What would the regular expression be to split(...) foo, such ...

26. What is the Java regex corresponding to the shell pattern 'test/*'?    stackoverflow.com

I want to see if a given string matches 'test/*', where the asterisk is marking any characters. How can I implement this with Java regular expressions? I tried mystring.matches("test[/].*+"), but it ...

27. Pattern lookahead    stackoverflow.com

Pattern p = Pattern.compile("(ma)|([a-zA-Z_]+)");
Matcher m = p.matcher("ma");
m.find();
System.out.println("1 " + m.group(1) + ""); //ma
System.out.println("2 " + m.group(2)); // null
Matcher m = p.matcher("mad");
m.find();
System.out.println("1 " + m.group(1) + ""); //ma
System.out.println("2 " + m.group(2)); // ...

28. Regular Expression and Pattern    stackoverflow.com

MP (((1.1 1.2, 2.1 1.5),(3.1 4.1)),((8.1 6.2, 2.5 4.5),(3.8 4.9)),((7.1 6.2, 2.5 5.5),(3.8 4.9))) In Java how i can split them to get double values. What pattern and reqex would be ? but ...

29. Dot behavior in regex patterns    stackoverflow.com

Pattern p2 = Pattern.compile(".*");
Matcher m2 = p2.matcher("true");
System.out.println(m2.matches() + " [" + m2.group() + "]");
When I use the code above it is all right. But I don't understand what is going on ...

30. Java Framework for automation based on Pixel Pattern recoginition    stackoverflow.com

I have to develop some kind of bot for a testing background with Java. We used Selenium for all the web stuff, and outside the browser: Pixel recognition; that is, taking ...

31. Learning Java RegEx patterns    stackoverflow.com

Possible Duplicate:
Learning Regular Expressions
I have been watching many people are using Regex patterns in Java to split or to do some special operations or ...

32. Java regex patterns    stackoverflow.com

I need help with this matter. Look at the following regex:

Pattern pattern = Pattern.compile("[A-Za-z]+(\\-[A-Za-z]+)");
Matcher matcher = pattern.matcher(s1);
I want to look for words like this: "home-made", "aaaa-bbb" and not "aaa - bbb", ...

33. Java regex pattern    stackoverflow.com

Is there any way of excluding this characters: - \ _ to this pattern? I need especifically this pattern and no other

Pattern pattern = Pattern.compile("[\\p{P}\\p{Z}]");

34. Java regex mix two patterns    stackoverflow.com

How can i get this pattern to work:

Pattern pattern = Pattern.compile("[\\p{P}\\p{Z}]");
Basically, this will split my String[] sentence by any kind of punctuation character (p{P} or any kind of whitespace (p{Z}). But ...

35. MD5 Java Pattern    stackoverflow.com

I am following BalusC's DAO Tutorial, where there is this function:

private static String hashMD5IfNecessary(String password) {
    return !"^[a-f0-9]{32}$".matches(password) ? hashMD5(password) : password;
}
which I coupled with:
<h:inputText value="#{myBean.password}" ...

36. Figuring out and check this Pattern    stackoverflow.com

So I want my inputs to be one of the following: 0 = any integer 0, 00, 000, 0:0, 00:0, 000:0 Basically 0-999, followed be an optional colon and 0-9. The pattern I am using is ([0-9]|([0-9][0-9])|([0-9][0-9][0-9]))|(([0-9]|([0-9][0-9])|([0-9][0-9][0-9]))&&\3A&&[0-9]) Is ...

37. Java RegEx Pattern takes too much time    stackoverflow.com

I have a script ( Java String) that contains a lot of SQL and SQL operators like <>(not equal to), ++(increment operator), := (assignment operator) but all of them by default ...

38. Repeat pattern in RegEx    stackoverflow.com

I've got an string parts which match to following pattern.

abcd|(|a|ab|abc)e(fghi|(|f|fg|fgh)jklmn)

But problem I have got is, my whole string is repeated combination of above like patterns. And my ...

39. Java Pattern issue    stackoverflow.com

I am getting a text from the DB which contains Strings of the form

CO<sub>2</sub>
In order to recognize this I wrote the following code
String footText = "... some text containing CO<sub>2</sub>";
String co2HTML ...

40. Symbol OR end of line pattern    stackoverflow.com

I need a pattern (java regexp) which matches if there is a comma after key or key is at the end of line. i.e it should match both of followings:

1. xxxkey,yyy
2. ...

41. What regex in java can capture and remove this pattern?    stackoverflow.com

Suppose I have a few lines out of wikipedia XML that looks like this:

[[Image:ChicagoAnarchists.jpg|thumb|A sympathetic engraving by [[Walter Crane]] of the executed "Anarchists of Chicago" after the ...

42. java regular expression exclusion list pattern    stackoverflow.com

I understand that when I do [^abc] this will match any thing other than a,b, and c. What if I want it to match anything other than a "..". So far ...

43. Pattern optimization    stackoverflow.com

I need to scrape some content from a HTTP response with Java. The required fields in the response are: foo, bar and bla. My current pattern is very slow. Any ideas ...

44. Java Regex - correct the pattern    stackoverflow.com

Pattern - <(\w+)>.+</\1> Input String - "Testing <tag>some <b>idiot</b> text</tag>idiot text continue.." Now I received the result as "<tag>some <b>idiot</b> text</tag>". Is there any way I can modify the pattern, so that it ...

45. new to regex, pattern behavior question    coderanch.com

46. Regex pattern help    coderanch.com

in my project, I need to replace all instances of text within brackets with "xxx" using Regex. I am having trouble with this though. Here is my pattern: \[.+\] It works OK if the String only has one set of brackets, however, if it has multiple pairs of brackets, it only finds the very first and very last bracket. For example: ...

47. regex Pattern class and spaces    coderanch.com

Hi, I was using the regex package to format data read from a excel spread sheet. I wanted to collapse a set of continous white spaces to a single white space. so I used the Pattern "\\s{2,)" and replaced it with " ". But I found that it worked only partially. Trying to debug I realised that the some of the ...

48. Class Pattern - regular expressions    coderanch.com

Hi I have a few regular expressions that each work seperately i.e. each find the strings that contain the its pattern. However I want to create an expression that is a combination of them all. Thus this new totalPattern will check if the string contains % at the beginning or end but does not contain \% at the end //finds % ...

49. need java regex pattern    coderanch.com

The "." has special meaning to a regex. In your case, you mean ".". The "*" means zero or more characters in a file expression. In regex, it means zero or more of the previous character. You need to add a "." to represent the previous character. So.... org\.eclipse\..*\.internal\..* That should be the regex. Unfortunately, this regex is held in a ...

50. need java regex pattern    coderanch.com

Hi, could someone please provide me with a regex pattern My requirement is as follows: I need to get method comments from java source file, by searching a method. For this i use java reflection to get method prototype. Then I construct a regular expression from the method prototype, to find the method in the source code. The prototype looks like ...

51. Regular expression pattern ${* }    coderanch.com

52. Silly Regexp using Java 1.5 Pattern    coderanch.com

I'm far from expert at RegEx but I use "The Regex Coach" to experiment. See what this does for you. ([^:]*):? Gives three matches abc:, def: and xyz on abc:def:xyz See if the parens give you capturing groups you can iterate through. [ August 16, 2006: Message edited by: Stan James ]

53. Using java.util.regex.Pattern    coderanch.com

54. Is using Regex pattern ideal for this situtation    coderanch.com

Hi All, I have a situation where in I get data in format as below I get this data in the form of a String array /Book/Subject/Fiction /Book/Subject/NonFiction /Periodical/Type/Magazine /Periodical/Type/Newspaper & many such more. In above we have like 3 level hierarchial structure (/Book/Subject/Fiction). In some cases I may get a 4 or 5 level structure. What I need to do ...

55. regular expression pattern    coderanch.com

56. How to use import java.util.regex.Pattern ?    coderanch.com

The '*' character by itself does not mean anything in regular expressions. If it follows a character, character class, or group, then it means 'zero or more' of the thing it follows. If your intention with "*welcome" is "zero or more of any character, welcome" then the expression you want is: ".*welcome"; The '.' character will match any character, and the ...

57. java.util.regex.Pattern    coderanch.com

58. Regex Pattern Name    coderanch.com

59. Tokenizing with regex pattern. Little confused!    coderanch.com

Im using a regex pattern to tokenize a String. The code runs fine but Im curious about the output. Here's the code: public class Test2 { public static void main(String[] args) { String[] tokens = args[1].split(args[0]); for(String s : tokens) System.out.println("Token: >"+s+"<"); } } My code prints brackets around the output to allow for whitespaces. Here is my command line invocation ...

60. Regex pattern doubt    coderanch.com

61. Need some help in regular expression pattern    coderanch.com

Hi, My output should be something like this matcher Test matcher ? Some text What i need actually is to match the whole anchor tag, but this code actually doesn't know to find the end of an anchor tag and it goes ahead to match it too.I just want to ...

62. Help with RegEx pattern    coderanch.com

Hi, I am trying to create a pattern which will check a string that could contain the keywords like 'foo' or 'bar' or 'baz'. Here are some sample strings foobar barfoo- bazbar-- these are valid strings, i wan to check which of the keywords are part of the string, and at what position. some invalid strings would be --foo foo-bar etc. ...

63. Pattern Error while using RegEx    coderanch.com

Hi All, I am stuck up with a problem while using Regular Expression. My requirement is : split a long string into maximum size of 125 letters and then insert a line break in between them. while splitting, it shouldn't split between the words. in short, i want to split a string into small strings whose length is 125 or at ...

64. Nesting or subroutines in RegEx Pattern class    coderanch.com

I'm writing a small parser for the "Content-Type" line in email and HTTP pages. I really want to break the one Pattern into two for more rational processing: private static final Pattern typesPattern = Pattern.compile( "^(application|audio|image|message|multipart|text|video|x-token)/(\\s*);", Pattern.CASE_INSENSITIVE); private static final Pattern xtokenPattern = Pattern.compile("x-.*", Pattern.CASE_INSENSITIVE); What I would like is for the "x-token" in the first pattern refer to the xtokenPattern ...

65. regexp pattern for alphanumeric    coderanch.com

66. Regex pattern to be used    coderanch.com

67. Regex pattern    coderanch.com

68. Regex pattern    coderanch.com

public class test { /** * @param args */ public static void main(String[] args) throws Exception { String email = extractEmail("http://firstname.lastname.blub.com/sdfsdf"); } public static String extractEmail(String content) { String email = null; String regex = "[^http:\\/\\/].*[^\\.blub][^\\.com*]"; Pattern pattern = Pattern.compile(regex); Matcher matcher = pattern.matcher(content); while (matcher.find()) { email = matcher.group(); System.out.println("email " + email); break; } return email; } }

69. Regex pattern    coderanch.com

Let's break down your regex: - (?<=http[s]?://twitter.com/) - a positive lookbehind for http://twitter.com/ and https://twitter.com/. Looks fine to me - ($|(.*)/|(.*)|\\?=) --- $ - end of string --- (.*)/ - anything followed by / --- (.*) - anything --- \\?= - a ? followed by = You clearly specify that you want / inside your match, both in (.*) and in ...

70. AND operation in java RegEX and Pattern    coderanch.com

Hi All, When we use the Pattern and Matcher to check if a string complies to a regular expression, how do we perform an AND condition. For example: Let say I have a really big string. To find out if that String has either 'DOG' or 'CAT' or 'ELEPHANT' word in it, I can use the logical OR (|) symbol. But ...

71. How to add removal of newLine in a regexp pattern    coderanch.com

Hello, I have a long String coming from a different system that I am escaping using regexp using: String pattern = "[^a-zA-Z0-9\\s]"; String[] title = item.getTitle().replaceAll(pattern,"").split(" "); i.e. reserve only alphanumeric and white spaces. The problem is that I still get the \n in the splitted array and I would like to remove it. I can do a replaceAll("\\n", "") on ...

72. doubt regarding patterns in regex    coderanch.com

74. regex.pattern need help understanding    java-forums.org

I am trying to learn how to use the match functions, and i have trouble understanding the following code. htmltag=pattern.compile(]*href=\"[^>]*>(.*?)) I have read the java artical about patterns but i still don't understand the code line, From what i understand, its trying to compile( ") Can anyone explain ...

75. Java.util.regex.Pattern    forums.oracle.com

76. White space in regular expressions (Pattern class)    forums.oracle.com

Hello, I have to check if a String contains ONLY the following characters: a-z, A-Z, ' and ( ) . The regular expression that I wanted to use with the Pattern class was [[a-zA-Z][\u0027][\u0028][\u0029][\s]] . Now, my compiler (Eclipse) doesnt recognize \s as an expression. Is this the proper expression for a white space? Also, in this notation, will the Pattern ...

77. RegExp pattern problem    forums.oracle.com

Yah, just to make sure, the pattern is actually a class variable I would like to provide an SSCCE but I'm embarassed by the state of my code... It is only a syntax highlighting text editor. What I have is an extended JScrollPane that grabs the visible text. This works fine. Then there is an extended JTextPane with associated DefaultStyledDocument. Many ...

78. regex pattern question    forums.oracle.com

79. Regarding patterns and regex    forums.oracle.com

80. User defined pattern ...regex.... Bioinformatics    forums.oracle.com

I am new to java and have to develope program for user defined pattern for the input protein/dna sequences . i have tried to solve the mystery by using regular expressions but i cant get the correct code. User defined pattern is used in bioinformatics to find particular pattern in the given input sequence, may be protein or nucleotide. i have ...

81. regex pattern question    forums.oracle.com

82. Use a string/word obtained as output in regex pattern    forums.oracle.com

Take a look at the code above. See the bits in red? Well they are the String literals. Looks like you are not compiling your regex correctly. As in have quotes and escapes in the wrong place. Unless it is the forum markup mangling it. Edited by: flounder on Nov 25, 2009 4:31 PM

83. pattern regex    forums.oracle.com

84. Regex patterns    forums.oracle.com

Hi all Bad time to be asking perhaps -_^ but any help offered will be very much appreciated, I'm not good with regular expressions. I need patters to match the following text in a string. 1. >any characters at all

85. ***Need Regex for a pattern    forums.oracle.com

Winston, I am searching this String/pattern in JavaScript file (*.js), parsing the JS file is very complex. Parser treats every string is one Node, and so its bit complex to identify for a particular string (which is mentioned in first thread). This is the reason for not using parser. So I switched back to Regex Pattern. Regards, Mallikarjun.

86. Help with RegEx pattern    forums.oracle.com

Hi, I am trying to create a pattern which will check a string that could contain the keywords like 'foo' or 'bar' or 'baz'. Here are some sample strings foobar barfoo- bazbar-- these are valid strings, i wan to check which of the keywords are part of the string, and at what position. some invalid strings would be --foo foo-bar etc. ...

87. regex with pattern    forums.oracle.com

* is a greedy modifier and will grab everything that it can and still satisfy the pattern, therefore, it will grab everything between the first and last c in the string. If you use a characters class with N, [N], then the pattern will only grab capital N characters, and the of course the next C. You could also experienment with ...

88. Regarding java.util.regex.Pattern info    forums.oracle.com

89. Regex Pattern question    forums.oracle.com

Hallo all, I have a problem. I am having a JTextField which is for the phone numbers. It may have these two formats 13456 12345-245 So my customer doesnt't allow me to enter the other alpha numerical signs or letters. This extension may appear but the user may also enter the phone number without the extension number. So how should I ...

91. Pattern and regex question    forums.oracle.com

Hi everybody, I've having some major trouble coming up with a pattern, and nothing I try seems to work, so I was hoping that someone on here could give me some help. So, basically, I have a string of words separated by spaces, like: a b c d e I'm running through a file, and there are places in the file ...

92. Does anybody understand this regex pattern?    forums.oracle.com

93. importing java.util.regex.Pattern class causes duplicate execution    forums.oracle.com

I had a working web page and then I inserted pattern matching to restrict displayed results based on user input. The program then started executing twice, apparently in parallel, producing primary key DB errors. The output to a log file was also duplicated but the messages (every one recorded twice) were interspersed. I commented out my code, except for the import ...

94. Creating a regex.Pattern for bulletin board tags    forums.oracle.com

I've used the current BB method for 5 years, and no-one has ever complained (about nested tags at least). The reason it's a problem now is that I'm going to insert links on-the-fly, while rendering the HTML, in texts where BB tags already exist. I was hoping I could insert them blindly, without checking for nested tags, and let my BB ...

95. regexp: quoted pattern    forums.oracle.com

By the way, wanto_, your memory isn't faulty: support for the \Q...\E feature is seriously buggy in java versions prior to Java 6/JDK 1.6. They should never be used inside character classes like you're doing here, because their effect is totally wrong. Otherwise, they're safe to use; they're just not as efficient as they should be. I practically never use them ...

96. abour a regex pattern    forums.oracle.com

97. regex problem using Pattern class    forums.oracle.com

98. Pattern Matching/Encoding    forums.oracle.com

99. regex pattern    forums.oracle.com

I have tried your regex pattern in my application it list all the lines with status "OK" and "WARNING", my problem is how to list "WARNING" and "OK" (It should have the same host name of the line with "WARNING" like pool30). Is it a possible to write a condition in regex pattern or anything?

100. Java Regex Pattern    forums.oracle.com

A regex is the least of your worries. Since the selection depends on values on two lines you need to build some form of map that links test names to lines that the test is involved in. You will then poplulate that map by parsing the lines. Think first about the map then about the regex.

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.