Jump to content

Dear RegEX gurus, my brain hurts..


 Share

Recommended Posts

I have the following data

asfaf

ZCZ

wtr

aphup

lkjk

a..etc

I would like to pick up the sections

asfaf

ZCZ

wtr

aphup

lkjk

etc

Obviously the real data is more complicated and varied.... ;)

Somehow I need to match the "a". The "a" needs to be included as the first entry in each section captured and the data I require includes everything up to the beginning of the next "a"

There is a workaround , where I can do a StringRegExpReplace($str,"a","@@a") and then match between the "a" and the "@@", but my feeling is that this can be achieved with the correct pattern.

Has Anyone any thoughts ?

Thanks.

Steve

Link to comment
Share on other sites

Well done, and thanks. I have adapted for my example and it works well.

This has been a great learning for me.

I never new about the ?= "look ahead" option. I can't see it documented in our help file (although now I have looked further it is on the online PCRE section ;) )

Thanks again.

Steve

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...