Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7761563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:10:06+00:00 2026-06-01T14:10:06+00:00

So I’m writing a Python package that will parse data from a real-time NOAAPORT

  • 0

So I’m writing a Python package that will parse data from a real-time NOAAPORT feed, and throw it into a SQL database. I’m having a hard time wrapping my head around RegEx.

I’m particularly looking to match the LAT…LON line:

LAT...LON 3153 10127 3153 10118 3152 10118 3142 10122
      3141 10127 3152 10127

and the best I can come up with is:

r'^LAT...LON(.*)'

But every two numbers after LAT…LON are latitude and longitude points, and I can’t seem to get it to match the next line of points.

Also this is optional, I would also like to group off certain sections of this tornado warning. I want to separate the WMO header “TORSJT” (The first three letters are the advisory type, and the last three are the weather office that issued the advisory. TOR=Tornado Warning SJT=San Angelo, TX weather office)

And then I just want the warning text separated:

BULLETIN - EAS ACTIVATION REQUESTED
TORNADO WARNING
NATIONAL WEATHER SERVICE SAN ANGELO TX
802 PM CDT SAT APR 7 2012

THE NATIONAL WEATHER SERVICE IN SAN ANGELO HAS ISSUED A

* TORNADO WARNING FOR...
  NORTHWESTERN IRION COUNTY IN WEST CENTRAL TEXAS...

* UNTIL 815 PM CDT

* AT 757 PM CDT...A SEVERE THUNDERSTORM CAPABLE OF PRODUCING A
  TORNADO WAS OVER EXTREME NORTHWESTERN IRION COUNTY...OR 24 MILES
  NORTHEAST OF BIG LAKE...MOVING SOUTH SOUTHWEST AT 15 MPH. THIS
  STORM HAS A HISTORY OF PRODUCING A TORNADO AND MAY PRODUCE A
  TORNADO AT ANY TIME.

  IN ADDITION TO DANGEROUS TORNADIC WINDS...OTHER HAZARDS INCLUDE...
  LARGE DAMAGING HAIL UP TO TENNIS BALL SIZE.
  DAMAGING STRAIGHT LINE WINDS IN EXCESS OF 60 MPH.
  POTENTIALLY DEADLY LIGHTNING.

*THE TORNADO WILL REMAIN OVER MAINLY RURAL AREAS OF...
  NORTHWESTERN IRION COUNTY.

PRECAUTIONARY/PREPAREDNESS ACTIONS...

A SEVERE THUNDERSTORM WATCH REMAINS IN EFFECT UNTIL 1000 PM CDT
SATURDAY EVENING FOR WEST CENTRAL TEXAS.

&&

I basically want everything placed into a dictionary, with all 3 getting its own key.

Here’s the whole warning intact for reference:

368
WFUS54 KSJT 080102
TORSJT
TXC235-080115-
/O.NEW.KSJT.TO.W.0012.120408T0102Z-120408T0115Z/

BULLETIN - EAS ACTIVATION REQUESTED
TORNADO WARNING
NATIONAL WEATHER SERVICE SAN ANGELO TX
802 PM CDT SAT APR 7 2012

THE NATIONAL WEATHER SERVICE IN SAN ANGELO HAS ISSUED A

* TORNADO WARNING FOR...
  NORTHWESTERN IRION COUNTY IN WEST CENTRAL TEXAS...

* UNTIL 815 PM CDT

* AT 757 PM CDT...A SEVERE THUNDERSTORM CAPABLE OF PRODUCING A
  TORNADO WAS OVER EXTREME NORTHWESTERN IRION COUNTY...OR 24 MILES
  NORTHEAST OF BIG LAKE...MOVING SOUTH SOUTHWEST AT 15 MPH. THIS
  STORM HAS A HISTORY OF PRODUCING A TORNADO AND MAY PRODUCE A
  TORNADO AT ANY TIME.

  IN ADDITION TO DANGEROUS TORNADIC WINDS...OTHER HAZARDS INCLUDE...
  LARGE DAMAGING HAIL UP TO TENNIS BALL SIZE.
  DAMAGING STRAIGHT LINE WINDS IN EXCESS OF 60 MPH.
  POTENTIALLY DEADLY LIGHTNING.

*THE TORNADO WILL REMAIN OVER MAINLY RURAL AREAS OF...
  NORTHWESTERN IRION COUNTY.

PRECAUTIONARY/PREPAREDNESS ACTIONS...

A SEVERE THUNDERSTORM WATCH REMAINS IN EFFECT UNTIL 1000 PM CDT
SATURDAY EVENING FOR WEST CENTRAL TEXAS.

&&

LAT...LON 3153 10127 3153 10118 3152 10118 3142 10122
      3141 10127 3152 10127
TIME...MOT...LOC 0102Z 355DEG 11KT 3148 10125

$$
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:10:07+00:00Added an answer on June 1, 2026 at 2:10 pm

    You’re basically trying to perform multi-line regex matching.

    Instead of using greedy matching, .*, try using something like this:

    import re
    
    regex = re.compile('LAT...LON([0-9\s]+)', flags=re.MULTILINE)
    matches = regex.search('''LAT...LON 3153 10127 3153 10118 3152 10118 3142 10122
          3141 10127 3152 10127
    TIME...MOT...LOC 0102Z 355DEG 11KT 3148 10125''')
    print re.split('\s+', matches.group(1))[1:-1]
    

    In a live console session:

    >>> import re
    >>> 
    >>> regex = re.compile('LAT...LON([0-9\s]+)', flags=re.MULTILINE)
    >>> matches = regex.search('''LAT...LON 3153 10127 3153 10118 3152 10118 3142 10122
    ...       3141 10127 3152 10127
    ... TIME...MOT...LOC 0102Z 355DEG 11KT 3148 10125''')
    >>> print re.split('\s+', matches.group(1))[1:-1]
    ['3153', '10127', '3153', '10118', '3152', '10118', '3142', '10122', '3141', '10127', '3152', '10127']
    >>>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I am currently running into a problem where an element is coming back from
I need a function that will clean a strings' special characters. I do NOT
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.