Sign in to follow this  
Followers 0
steve8tch

Dear RegEX gurus, my brain hurts..

3 posts in this topic

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

Share this post


Link to post
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

Share this post


Link to post
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
Sign in to follow this  
Followers 0