Sign in to follow this  
Followers 0
Skampp

Finding a [ with StringRegExp

4 posts in this topic

Dear Community,

I am attempting to search for particular lines that begin with a square bracket, such as:

[19:05:23] Frankie Say Relax

But of course this is not working...

If $c > 1 And StringRegExp($fArray[$x], '[') = 1 Then 
   ...do stuff

Any ideas what is the proper way?

Thanks in advance!

Share this post


Link to post
Share on other sites



Skampp,

Try it like this.  If that does not work, post a reproducer that runs (or your whole script)...

If $c > 1 And StringRegExp($fArray[$x], '\[')  Then 
   ...do stuff

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

"lines that begin with a square bracket" ... why not

If StringLeft($fArray[$x], 1) = '['  Then ...
Edited by mikell

Share this post


Link to post
Share on other sites

just a question not a solution why not to use

StringInStr

thank you

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