Click here to Skip to main content
15,901,035 members
Home / Discussions / Java
   

Java

 
AnswerRe: while signing the same data multiple times does signature vary? Pin
IICTECH11-Dec-12 19:47
IICTECH11-Dec-12 19:47 
Questionwhile signing the same data multiple times does signature vary? Pin
syam0716-Dec-12 19:28
syam0716-Dec-12 19:28 
AnswerRe: while signing the same data multiple times does signature vary? Pin
Richard MacCutchan6-Dec-12 22:31
mveRichard MacCutchan6-Dec-12 22:31 
QuestionlookupMultiDocPrintServices and Win32 Pin
J-Cop6-Dec-12 3:11
J-Cop6-Dec-12 3:11 
QuestionJCOMBOBOX Pin
Chrisloys4-Dec-12 2:40
Chrisloys4-Dec-12 2:40 
AnswerRe: JCOMBOBOX Pin
Richard MacCutchan4-Dec-12 4:52
mveRichard MacCutchan4-Dec-12 4:52 
GeneralRe: JCOMBOBOX Pin
Chrisloys4-Dec-12 5:36
Chrisloys4-Dec-12 5:36 
GeneralRe: JCOMBOBOX Pin
Richard MacCutchan4-Dec-12 5:58
mveRichard MacCutchan4-Dec-12 5:58 
GeneralRe: JCOMBOBOX Pin
Chrisloys4-Dec-12 6:04
Chrisloys4-Dec-12 6:04 
GeneralRe: JCOMBOBOX Pin
Richard MacCutchan4-Dec-12 6:10
mveRichard MacCutchan4-Dec-12 6:10 
GeneralRe: JCOMBOBOX Pin
Chrisloys4-Dec-12 6:12
Chrisloys4-Dec-12 6:12 
GeneralRe: JCOMBOBOX Pin
Richard MacCutchan4-Dec-12 6:34
mveRichard MacCutchan4-Dec-12 6:34 
GeneralRe: JCOMBOBOX Pin
Chrisloys4-Dec-12 6:41
Chrisloys4-Dec-12 6:41 
GeneralRe: JCOMBOBOX Pin
Richard MacCutchan4-Dec-12 6:44
mveRichard MacCutchan4-Dec-12 6:44 
GeneralRe: JCOMBOBOX Pin
Chrisloys4-Dec-12 6:47
Chrisloys4-Dec-12 6:47 
GeneralRe: JCOMBOBOX Pin
Richard MacCutchan4-Dec-12 7:24
mveRichard MacCutchan4-Dec-12 7:24 
Questionneed help Pin
dipfol29-Nov-12 17:56
dipfol29-Nov-12 17:56 
AnswerRe: need help Pin
AprNgp29-Nov-12 20:08
AprNgp29-Nov-12 20:08 
AnswerRe: need help Pin
Richard MacCutchan29-Nov-12 21:51
mveRichard MacCutchan29-Nov-12 21:51 
Questionextract battery percentage Pin
akki23099127-Nov-12 20:55
akki23099127-Nov-12 20:55 
AnswerRe: extract battery percentage Pin
Richard MacCutchan27-Nov-12 23:59
mveRichard MacCutchan27-Nov-12 23:59 
Questioni have a problem around System.console, am using eclipse Pin
Member 963455227-Nov-12 0:31
Member 963455227-Nov-12 0:31 
AnswerRe: i have a problem around System.console, am using eclipse Pin
TorstenH.27-Nov-12 1:44
TorstenH.27-Nov-12 1:44 
I don't know where you got that console hassle there - it's a complete mixup.

Your code works when the console is addressed right:

Java
public class RegexTestHarness {

	public static void main(String[] args) {
		while (true) {
			try {
				BufferedReader console = new BufferedReader(new InputStreamReader(System.in)); // only this can provide a buffered reading
				System.out.println("Enter your regex:");
				String strValue = console.readLine(); // read value
				Pattern pattern = Pattern.compile(strValue); // create pattern
			
				System.out.println("Enter input string to search:");
				String strMatch = console.readLine();
				Matcher matcher = pattern.matcher(strMatch);
	
				boolean found = false;
				while (matcher.find()) {
					System.out.println(String.format("I found the text" + " \"%s\" starting at "
							+ "index %d and ending at index %d.",
							matcher.group(), matcher.start(), matcher.end()));
					found = true;
				}
				if (!found) {
					System.console().format("No match found.");
				}
			} catch (IOException oException) { oException.printStackTrace();} // for the buffered reader - in case it fails
		}
	}
}

regards Torsten
When I'm not working

GeneralRe: i have a problem around System.console, am using eclipse Pin
Member 963455228-Nov-12 2:00
Member 963455228-Nov-12 2:00 
GeneralRe: i have a problem around System.console, am using eclipse Pin
TorstenH.28-Nov-12 8:36
TorstenH.28-Nov-12 8:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.