Hi All :
I am using the following code:
String sample = "::";
String[] splitTime = sample.split(":");
// extra detail omitted
System.out.println("Value 1 :"+splitTime[0]);
System.out.println("Value 2 :"+splitTime[1]);
System.out.println("Value 3 :"+splitTime[2]);
I am getting ArrayIndexOutofBound exception. ... |
111111111 - Invalid
A121278237 - Invalid
7777777777 - Invalid
121263263 - Valid
111111112 - Valid
|
I want to compare an URI String over different patterns in java and I want fastest code possible.
Should I use :
if(uri.contains("/br/fab") || uri.contains("/br/err") || uri.contains("/br/sts")
Or something like :
if(uri.matches(".*/br/(fab|err|sts).*"))
Note that I ... |
Valid: abc abc11
Invalid: 11 a-b a&&b a << b a&b a->b
|
I'm trying to find a regex to separate out the author and book title information from a data set.
This one seems to work fine:
^\s*(?:(.*)\s+-\s+)?'?([^']+'?.*)\s*$
On the data below, it identifies an author ... |
e.g
if("viewCategoryTree".equals(actionDetail)
|| "fromCut".equals(actionDetail)
...
|
I need a regular expression for:
String must be Captial letters(A-Z)
and contain digits (0-9)
|
|
I have never done regex before, and I have seen they are very useful for working with strings. I saw a few tutorials (for example) but I still cannot ... |
Does someone know a way on how to check, in Java, if a string containing tags seperated by space, comma or semicolon (or any non-word character) contains a given tag?
For example:
Sample ... |
I am trying to see whether a string contains at least a digit or a lowercase or an uppercase.
I have written something like this:
int combinations ...
|
I am trying to form a regex that functions as mentioned below:
String killing of <span class="abc">cats</span>, hi <span class="xyz">dogs</span>,
Splits into :
1. killing
2. of
3. <span class="abc">cats</span>,
4. hi
5. <span class="xyz">dogs</span>,
This regex \\<.*?\\>| splits ... |
I would like to know the regex to pull data from a string in Java which will have following start and end tag info.
String temp = "<!--abc Start-->..data...<!--abc end-->"
So ... |
I'm looking to split a string using Java if it contains a digit or underscore - but I want to include the digit in the result - is this possible?
Eg.
"Linux_version"
"Linux3.1.2.x"
I want ... |
I'm looking for how to create a regular expression, which is 100% equivalent to the "contains" method in the String class. Basically, I have thousands of phrases that I'm searching for, ... |
That's because you use ^ and $. These stand for "start of the string" and "end of the string" respectively. You are literally saying: I want the start of the string, then one single character (are you sure you didn't omit a + or * there?), then the end of the string. |
I have huge sting(xml) containing normal character a-z,A-Z and 0-9 as well as special char( <,>,?,&,',",;,/ etc.) I need to split this sting where it ends with for e.g. Original String: - sdf
- sd
hi The above sting has to be splited in to two parts since it is having two document tag. Can any body help me to ... |