Jump to content

regexp same pattern multiple times


Recommended Posts

it should search for the same pattern multiple times and put it's findings into $data, but it's not working any suggestions?

#include <Array.au3>
$text = "1234asd1234kjhfkg1234jhdfgk1234kdhfg1234dfgdfg1234dfgd1234"
    $data = StringRegExp($text,"(34([[:alpha:]]+)12){1,10}",1)
    _ArrayDisplay($data,"data")
Link to comment
Share on other sites

  • Moderators

Try putting 3 instead of 1 in the 3rd parameter.

Edit:

#include <Array.au3>
$text = "1234asd1234kjhfkg1234jhdfgk1234kdhfg1234dfgdfg1234dfgd1234"
$data = StringRegExp($text,"(34([[:alpha:]]+)12)",3)
_ArrayDisplay($data,"data")

Edit2:

This almost looks like what you're trying to do if the above is not:

#include <Array.au3>
$text = "1234asd1234kjhfkg1234jhdfgk1234kdhfg1234dfgdfg1234dfgd1234"
$data = StringRegExp($text,"(34[[:alpha:]]+12)",3)
_ArrayDisplay($data,"data")
Edited by SmOke_N

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