Jump to content

Regular Expressions, Remembering Patterns


nago
 Share

Recommended Posts

Hello!

I know in sed you can write something like:

s/ab\(.*\)cde/\1/

where sed will match for ab[wildcard]cde, but whenever it matches this, it saves the part in parenthesis (here the wildcard) in my example, to \1.

How do you accomplish this in AutoIt? For example, parsing an HTML file to find what's within a header:

$pattern = '<h3>.*</h3>'
StringRegExp($input,$pattern)

How do I recall what .* matched?

Link to comment
Share on other sites

Hello!

I know in sed you can write something like:

s/ab\(.*\)cde/\1/

where sed will match for ab[wildcard]cde, but whenever it matches this, it saves the part in parenthesis (here the wildcard) in my example, to \1.

How do you accomplish this in AutoIt? For example, parsing an HTML file to find what's within a header:

$pattern = '<h3>.*</h3>'
StringRegExp($input,$pattern)
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...