Re: java.regex
On 30 Dec 2005 08:57:37 -0800, "friend.05" <hirenshah.05@xxxxxxxxx>
wrote, quoted or indirectly quoted someone who said :
>Instead of using string, can I directly use file. In matcher I want to
>use "file.txt".
I think I explained this already in one of your multiposts that you
could not. You must read the file into a String.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
.
Relevant Pages
- Re: Need help with regular expression to parse URLs
... The matcher gives me 1 group with this value: ... You can get the individual elements with smaller capturing groups: ... What you can do is make a regexp which matches a single occurrence of a pair of elements, and then use the Matcher's findmethod to loop over all occurrences in the string. ... URI uri = new URI; ... (comp.lang.java.programmer) - Re: Prefixes of regular expressions
... prefix. ... Match the supplied string against the first; ... If matched, display ... For some situations you could probably use groupCounton the Matcher ... (comp.lang.java.programmer) - Re: Java regex syntax
... I see that Matcher takes a CharSequence, not a String, but String implements CharSequence. ... I actually know my way around regexes reasonably well; the problem was in the translation to the Java idiom. ... (comp.lang.java.programmer) - Is matching against several regexs so clumsy?
... I'd like to search for several regex's in a String, ... position is set position=macherObject.endwhenever a regex is found. ... The only way I found was to create a Pattern and a Matcher for each ... public static void main{ ... (comp.lang.java.programmer) - Re: Prefixes of regular expressions
... prefix. ... Match the supplied string against the first; ... If matched, display ... For some situations you could probably use groupCounton the Matcher ... (comp.lang.java.programmer) |
|