I was wondering if there are any general guidelines for when to use regex VS "string".contains("anotherString") and/or other String API calls?
While above given decision for .contains() is trivial (why bother with ...
I am trying to use regular expressions to determine what format the user have applied when entering input in a textbox.
The regular expressions are as follows:
I am doing some fairly extensive string manipulations using regular expressions in Java. Currently, I have many blocks of code that look something like:
Matcher m = Pattern.compile("some pattern").matcher(text);
StringBuilder b = new ...
I am writing a program that has to strip pretty long strings of quite a lot of rubbish. I do that using regular expressions, and as my program is rather sensitive ...
Part of the code I'm working on uses a bunch of regular expressions to search for some simple string patterns (e.g., patterns like "foo[0-9]{3,4} bar"). Currently, we use statically-compiled Java Patterns ...
Please can someone tell me how to match "_" and a period "." excatly one time in a string using regex, Also is it more efficient using indexOf() instead of regex ...
Hi, I am building a module to extract data from text files using the java.util.regex package. I have to process thosands of text documents so performance is a must. I define regular expressions to match regions of the file, and further regular expressions to match fields within those regions. Since the regex package uses the CharSequence interface, more or less I ...
Hi, I wrote [a very simple benchmark|http://mypatterns.free.fr/java/stable/mypatterns/doc/regex.html] for measuring the cost of regex matching, as provided by java.util.regex, and I'm obtaining an overhead between 10 to 13 times(!!) for a very simple regex: "File ([^ ]*) not (found|readable).*!!!" when compared with equivalent hand-coded matching. The questions I have are: - is it a well-known fact that java.util.regex matching can add an ...
I have written a pretty large set of RegEx operations that run quite speedily on my MacBook Pro, but when I move the code to a Windows server (that will be the final deployment machine), the code runs about 1/1000 as fast. What's going on here? The MacBook Pro is a Core 2 Duo and the Windows machine is a 3.0Ghz ...