struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Prasad, Kamakshya" <kpra...@capitalservicing.co.jp>
Subject RE: Question regarding regex
Date Wed, 28 Apr 2004 09:48:06 GMT
Hi,

Thank you very much. It worked. 

Few more questions:

1. To include those words which doesn't have a blank in the front but
are at the start of the string?

2. Any good reference link having detailed explanation of java regex

Thanks,
KP


-----Original Message-----
From: Ivan [mailto:ivan@interd4u.com] 
Sent: Wednesday, April 28, 2004 5:55 PM
To: Struts Users Mailing List
Subject: Re: Question regarding regex

ok, try this

Pattern pattern = Pattern.compile("\\s([a-z]{1,})\\.");

Matcher matcher = pattern.matcher(" dfg. asf.sdf. ddf.");

 while (matcher.find()) {
            String letters = matcher.group(1);
 
 ...
 
 }


----- Original Message ----- 
From: "Prasad, Kamakshya" <kprasad@capitalservicing.co.jp>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Wednesday, April 28, 2004 10:22 AM
Subject: RE: Question regarding regex


HI,

I am doing it in a java class using java.util.regex package. 
It's still not giving desired result and showing the whole string.

KP

-----Original Message-----
From: Ivan [mailto:ivan@interd4u.com] 
Sent: Wednesday, April 28, 2004 5:18 PM
To: Struts Users Mailing List
Subject: Re: Question regarding regex

maybe it is \s[a-z]+\.     (there is a dot at end of this line, \ . <--)

----- Original Message ----- 
From: "Prasad, Kamakshya" <kprasad@capitalservicing.co.jp>
To: <user@struts.apache.org>
Sent: Wednesday, April 28, 2004 8:40 AM
Subject: Question regarding regex


Hi,
 
I have a string like this " txn.abc tde.gfd" . I want to get all those
words which have a blank in the front and a dot at the end. 
 
How to do this using the regex pattern and split function? What pattern
should be used?
 
KP


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message