Regular Expression Help

M

Mr.Steskal

I need help writing a regular expression that only returns part of a
string.


For Example I have a multi-line text fragment like below:


PC ADVISORS, LC
1234 MT. PARMA ROAD. SUITE A1
ATLANTA, GA 30097
PH. (404) 555-1212


I write a regular express that retrieves the second line. I want to
only return all the data before SUITE A1 in the line. The regular
expression I have so far is "\n\n.*?! S" . This returns "1234 MT.
PARMA ROAD. S" . Could anybody help me figure out how to write a
regular expression that only returns "1234 MT. PARMA ROAD." . The
stipulation is that the first part of the line is a variable length.


Thanks,


John
 
R

rowe_newsgroups

I need help writing a regular expression that only returns part of a
string.

For Example I have a multi-line text fragment like below:

PC ADVISORS, LC
1234 MT. PARMA ROAD. SUITE A1
ATLANTA, GA 30097
PH. (404) 555-1212

I write a regular express that retrieves the second line. I want to
only return all the data before SUITE A1 in the line. The regular
expression I have so far is "\n\n.*?! S" . This returns "1234 MT.
PARMA ROAD. S" . Could anybody help me figure out how to write a
regular expression that only returns "1234 MT. PARMA ROAD." . The
stipulation is that the first part of the line is a variable length.

Thanks,

John

\r\n.*(?= S)

Thanks,

Seth Rowe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top