Jump to content

Help with StringRegExp


Recommended Posts

  • Moderators

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Moderators

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.

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...