Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Getting substring by regex

Reply
Thread Tools

Getting substring by regex

 
 
Christine Mayer
Guest
Posts: n/a
 
      09-06-2007
Hi, I got a String that is composed of digits, white space, numbers
and other characters.
Example: 03... London (first two digits of post code, plus 3 dots for
the remaining digits).

I want to go through the String and search for the first occurrence of
a letter (A-Za-Z).
Then I want the String from this point on, excluding the "post code
String" containing only numbers, whitespace and dots.
The class String seems to have a "split(regex) function, but this
didn't work for me.

Any idea how this could be done?

Thanks in advance,

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with regex and optional substring in search string Timur Tabi Python 4 10-14-2009 10:22 PM
How make regex that means "contains regex#1 but NOT regex#2" ?? seberino@spawar.navy.mil Python 3 07-01-2008 03:06 PM
Getting substring by regex Christine Mayer Java 5 09-07-2007 04:38 AM
Getting substring by regex Christine Mayer Java 0 09-06-2007 05:52 PM
RegEx search for a substring within a substring colinhumber@gmail.com Perl Misc 3 08-03-2005 04:29 PM



Advertisments