Sign in to follow this  
Followers 0
erezlevi

stringregexp need help

2 posts in this topic

I need to write a stringregexp that matches the following:

[1;1H, [24;0H, [1;1H....

meaning everything that start with (Chr (27)) and end with capital "H" and is in the lenght of 7 total.

any idea?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I need to write a stringregexp that matches the following:

[1;1H, [24;0H, [1;1H....

meaning everything that start with (Chr (27)) and end with capital "H" and is in the lenght of 7 total.

any idea?

I think this should archive the desired result.

#include <array.au3>
$sString = '[1;1H, [24;0H, [1;1H....'
$sRegExPattern = '\x1B.{4,5}H'
$aMatches = StringRegExp($sString,$sRegExPattern,3)
_ArrayDisplay($aMatches,'$aMatches')

For a detailed explanation see the attached file.

Edited by Bowmore

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

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