Re: [Eug-lug] Regex

2006-01-18 Thread Jim Beard
I now have a clue where the bug is. Although java is printing out < and $gt;, each "string" is being treated as an actual character. If I do xml.charAt(0), it returns a char that will print as "<" Pretty f*ing annoying if you ask me... So thanks for all the regex advice. I'm guessin

Re: [Eug-lug] Regex

2006-01-17 Thread Bob Miller
Russ Johnson wrote: > I know that, but s/

Re: [Eug-lug] Regex

2006-01-17 Thread Russ Johnson
Allen Brown wrote: Jim wants to do the opposite conversion. Regular expressions don't simply reverse. In other words s/a/./g has a very different behavior than s/./a/g I know that, but s/

Re: [Eug-lug] Regex

2006-01-17 Thread Fred James
Jim Beard wrote: Ok, I know this isn't exactly the list for it, but I've been reading online for a while now and can't make heads or tails of my problem. I want to match convert '<' sequences to '<' using a replace method that matches on a regex pattern. I'm using Java and am having 0

Re: [Eug-lug] Regex

2006-01-17 Thread Jim Beard
Yes, I tried this pattern originally. Trying it again still yields an unchanged string. I have no clue where the bug is... On Jan 17, 2006, at 3:40 PM, Mike Cherba wrote: From what I can tell, the correct option should be: "\\<\\;". Since the regex you want is "\<\;" and Java needs the bac

Re: [Eug-lug] Regex

2006-01-17 Thread Bob Miller
Jim Beard wrote: > m_asynchro = m_asynchro.replaceAll("\\c<\\c;", "<"); > m_asynchro = m_asynchro.replaceAll(">", ">"); I don't know Java, but I think you want this. m_asynchro = m_asynchro.replaceAll("\\<\\;", "<"); m_asynchro = m_asynchro.replaceAll("\\>\\;", ">");

Re: [Eug-lug] Regex

2006-01-17 Thread Mike Cherba
>From what I can tell, the correct option should be: "\\<\\;". Since the regex you want is "\<\;" and Java needs the backslashes escaped in string literals. -Mike On Tue, 2006-01-17 at 15:14 -0800, Jim Beard wrote: > You are basically correct Mike. > > <--- Sample Code --> >

Re: [Eug-lug] Regex

2006-01-17 Thread Allen Brown
Russ Johnson wrote: Jim Beard wrote: I know this isn't exactly the list for it, but I've been reading online for a while now and can't make heads or tails of my problem. I want to match convert '<' sequences to '<' using a replace method that matches on a regex pattern. I'm using Java and a

Re: [Eug-lug] Regex

2006-01-17 Thread Jim Beard
You are basically correct Mike. <--- Sample Code --> // set up the xml string File asynchFile = new File("../some.xml"); FileReader asynchFileReader = new FileReader(asynchFile); BufferedReader bufferedASynchReader = new BufferedReader (asynchFileReader); String line = buffe

Re: [Eug-lug] Regex

2006-01-17 Thread Russ Johnson
Jim Beard wrote: I know this isn't exactly the list for it, but I've been reading online for a while now and can't make heads or tails of my problem. I want to match convert '<' sequences to '<' using a replace method that matches on a regex pattern. I'm using Java and am having 0 luck. No

Re: [Eug-lug] Regex

2006-01-17 Thread Mike Cherba
Jim, I just want to make sure I understand exactly what you are doing. You have an input string which contains some number of instances of the substring "<". you would like to make a duplicate copy of the string where the instances of "<" have been replaced by instances of "<" I assume y

[Eug-lug] Regex

2006-01-17 Thread Jim Beard
Ok, I know this isn't exactly the list for it, but I've been reading online for a while now and can't make heads or tails of my problem. I want to match convert '<' sequences to '<' using a replace method that matches on a regex pattern. I'm using Java and am having 0 luck. No sites on