Jump to content
Sign in to follow this  
golfinhu

Stringregexp

Recommended Posts

Hi, i need a little help:

I have this string:

##### Strings (here) #####

string 1

string 2

string 3

string 4

##### Strings (not here) #####

string 5

string 6

string 7

string 8

i trying to capture the text above "##### Strings (here) #####" until blank line

i tried this:

StringRegExp($Value, "(?i)(?m)##### Strings (here) #####v+[whv]*", 3)

but the return is:

[0] = ##### Strings (here) #####

string 1

string 2

string 3

string 4

but wath i need is this:

[0] = string 1

[1] = string 2

[2] = string 3

[3] = string 4

anyone help me?

thanks a lot

Edited by golfinhu

Share this post


Link to post
Share on other sites

Did you try _StringBetween()?


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

Share this post


Link to post
Share on other sites

Why not?

#include <String.au3>
#include <Array.au3>

Local $sTest = "##### Strings (here) #####" & @CRLF & _
"string 1" & @CRLF & _
"string 2" & @CRLF & _
"string 3" & @CRLF & _
"string 4" & @CRLF & _
"" & @CRLF & _
"##### Strings (not here) #####" & @CRLF & _
"string 5" & @CRLF & _
"string 6" & @CRLF & _
"string 7" & @CRLF & _
"string 8" & @CRLF

Local $sNew = _StringBetween($sTest, "##### Strings (here) #####" & @CRLF, @CRLF & @CRLF)
Local $aNew = StringSplit($sNew[0], @CRLF, 3)

_ArrayDisplay($aNew)

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

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...