Jump to content
UBot Underground

Regex for text with line break


Recommended Posts

I have a very basic understanding of regex and have used it in alot of my bots, but I am totally stuck.

 

I have scraped this text from a page into a variable:

 

Feb 05, 2013 05:20 PM Medical Center
Chief Complaint

Attending Physician

Discharge Disposition

Discharge Date


Insurance
OJ BOLE HEALTHCARE 1000171

 

I am trying to pull in everything after Insurance (and will then separate the name of the health plan and the number separately)

 

I figured I would just set a variable {Insurance Info} using Insurance.* as the Regex to grab everything.

 

Then Replace Insurance in {Insurance Info} with $nothing

 

Set a variable for the {Insurance number} by doing a find by regular expression [0-9]* on {Insurance Info}

 

And then create an {Insurance Name} variable by doing a find replace on {Insurance Info} and replacing {Insurance Number} with nothing.

 

The problem I am having with this is the first regex Insurance.* only grabs Insurance and not all the characters after it.  I am guessing this has to do with the ine break and after much googling, I just can't figure it out. 

 

Does anyone have any ideas of what the initial expression needs to be to grab everything?

Link to post
Share on other sites

It never fails... I post a question after hours of searching and then find the answer!

 

Insurance\s\S.*  does the trick because .* alone does not capture line breaks!

 

I learn something new using uBot every day. 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...