Sign in to follow this  
Followers 0
diepfeile

regexp same pattern multiple times

2 posts in this topic

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")

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

[center]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.[/center]

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