Jump to content
Sign in to follow this  
AustrianOak

Help with StringRegExp

Recommended Posts

AustrianOak

What pattern do I use to filter out the text 'type' in the below string.

Forgive me as I'm just starting out in this function.

text | number | type;

Share this post


Link to post
Share on other sites
SmOke_N

What pattern do I use to filter out the text 'type' in the below string.

Forgive me as I'm just starting out in this function.

text | number | type;

Pretty sure I've given this to you before.

However, you're question is not really thought out well.

1. Is it always at the beginning of the string?

2. Is it always named "text"?

3. Is it always delimited by "|"?

The answer to your question could be:

StringRegExpReplace("text | number | type;", "^text\s\|", "")

Or

StringRegExpReplace("text | number | type;", "^.*?\|", "")

But to be exactly what you want... you have to explain "Exactly" what you want.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
AustrianOak

1. Is it always at the beginning of the string?

Yes

2. Is it always named "text"?

No, it usually varies. (I may have not explained it clear in my first post but I want to retrieve the text "type")

3. Is it always delimited by "|"?

Yes

Edited by nowagain

Share this post


Link to post
Share on other sites
AustrianOak

can someone please help?

Share this post


Link to post
Share on other sites
SmOke_N

can someone please help?

Err... help? I already gave the answer with the 2nd StringRegExpReplace() :)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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  

×