-1
votes
1answer
78 views

How to split a string by “/” and “//”?

I'm trying to create a basic model viewer for Wavefront Object files, and part of the reading of the file includes splitting each line. The faces are defined based on slashes. These are the ...
0
votes
2answers
36 views

Android: Restricting textfield to one decimal point

How to restrict an EditText Field to only one decimal point. Let's say the user should enter only one digit/number after the (.)[decimal]. User enters : 1.92 [Its invalid] User enters : 1.9 [Its ...
2
votes
1answer
100 views

Reading Huge Data With Java

Firstly, I'm sorry about my English. I looking for an effective a way to read a Big file in java. I make a log analysis program and I have log files at least from 500 MB to 4 GB. I have tried the ...
0
votes
3answers
58 views

How to ignore characters before and after my pattern?

I need some help creating a regex (in java) to find a pattern like: (30.6284, -27.3493) It's roughly a latitude longitude pair. Building from smaller pieces, I've come up with this: String def = ...
1
vote
2answers
43 views

URL Anchor Text Regular Expression Puller

So I'm trying to figure out a regular expression that simply will not work for me. I've never been very good at writing them, and was hoping somebody could explain what I'm doing wrong here. I'm ...
2
votes
2answers
33 views

prevent regex matches both ahead and behind with lookarounds?

I'm trying to match a command through voice recognition on android. The recognition is fine but I'm running into trouble with crafting one of my regex patterns (the program uses java.util.regex) I ...
0
votes
1answer
57 views

Verify this condition with regular condition

I have the following string: "1,4,6,22,88,105:22" How can I write a regular expression that checks the left part of the ':' and if one of the numbers is small than 'x' or greater than 'y' gives an ...
2
votes
3answers
54 views

Java regular expression on matching asterisk only when it is the last character

Anyone can spot any error in this code? String value = "/files/etc/hosts/*"; if (value.matches("\\*$")) { System.out.println("MATCHES!"); } I am trying to do some operation when ...
0
votes
1answer
41 views

Append a digit in front of another digit between /s?

I have a bunch of strings that looks like this /files/etc/hosts/2/ipaddr /files/etc/hosts/2/canonical /files/etc/hosts/2/alias[1] /files/etc/hosts/3/ipaddr /files/etc/hosts/3/canonical ...
-4
votes
1answer
54 views

Extracting words using regular expression [closed]

In the sentence -[Multiple space characters] 1GB – 10TB is $0.19/GB I am trying to extract 1GB, 10TB, %0.19/GB. I tried using the regular expression ("-.*(\\d.*)-(\\d[^ ])\\sis\\s(.+) in java ...
0
votes
4answers
41 views

Java Regex: find a match only at the beginnings of words

For example, I have a set of the strings: "Abc zcf", "Abcd zcf", "Zcf Abc", "Zcf Abcd", "Test ez", "Rabc Jabc" How to find in this set strings which any word begin at "abc" characters? In my ...
0
votes
2answers
46 views

Replacing an unknown pattern size with a character

Is there a way to replace a specific repetitive character using regular expressions? Example: str = "Anne has nnnn things" The solution would be: "Ane has n things" If a string has ...
0
votes
1answer
29 views

Change group using regex java

I need help in regular expression using in regex java. I need change group in string: Example: Input: =sum($var1;2) or =if($result<10;"little";"big") ... Need Output: =sum(teste;2) or ...
0
votes
2answers
33 views

RegEx to split string based on operators and retain operator in answer

I want to split string based on few operands. For e.g. String : a&&(b||c) ANS : String[] {a,&&,(,||,c,)} IS it possible with java RegEx? If yes then how? I tried with ...
0
votes
2answers
42 views

String.matches fails every test?

I have an really odd behaviour of String.matches: requestString.matches(".*") (boolean) false while requestString is something like "HTTP/1.1 200 OK - OK [...] Content-Type: text/xml; ...

1 2 3 4 5 407
15 30 50 per page