Jump to content

Recommended Posts

Posted (edited)

"-s |" start

The end of arbitrary letters and numbers

example:

-s|test12345

-s|232test

^([\/\-]s[\|])[a-zA-Z0-9]$

This is wrong, the right to express how ?

Edited by sanhen
Posted

regexp could be a hard function to understand..

I'm not best but you can try downloading expresso,

http://www.ultrapico.com/Expresso.htm

I've found it very helpfull..

And theres a nice forum that is all about help in regexp

http://regexadvice.com/forums/default.aspx?GroupID=19

...

Posted

"-s |" start

The end of arbitrary letters and numbers

example:

-s|test12345

-s|232test

^([\/\-]s[\|])[a-zA-Z0-9]$

This is wrong, the right to express how ?

What exactly are you trying to capture? Everything after -s| ?

In that case, use this: ^-s\|(.*)$

Posted

"-s |" start

The end of arbitrary letters and numbers

example:

-s|test12345

-s|232test

^([\/\-]s[\|])[a-zA-Z0-9]$

This is wrong, the right to express how ?

Flag 3

(?:-s\|)(.*)

You could also just do

$Split = StringSplit($Text, "|")

$Split[1] = -s

$Split[2] = test12345

FYI I wrote a pretty nice SRE/SRER tester. It's in my sig=)

Posted

Hi sanhen,

Doing a search of your topic, it's been found many times with the search feature or is listed as a non-descriptive topic.

Please do a search before posting new thread topics.

And please use descriptive topics so that others that do use the search feature may also find what they are seeking.

(You'll also find that using descriptive topics, will get people in your thread that know how to answer your questions, those same people ignore non-descriptive topics).

Thanks.

Posted

Hi sanhen,

Doing a search of your topic, it's been found many times with the search feature or is listed as a non-descriptive topic.

Please do a search before posting new thread topics.

And please use descriptive topics so that others that do use the search feature may also find what they are seeking.

(You'll also find that using descriptive topics, will get people in your thread that know how to answer your questions, those same people ignore non-descriptive topics).

Thanks.

Look bro. I don't know if your self appointed or highered for 'official' lame responses. But this question isn't something that would get answered by a search.

String RegEx'ing can be very hard for some people. And what would he have searched for?

"^([\/\-]s[\|])[a-zA-Z0-9]$ "?

Give him a break. Seriously...

:)

next time 问我

不要要求他。 他不知道什么他做着
  • Moderators
Posted

Look bro. I don't know if your self appointed or highered for 'official' lame responses. But this question isn't something that would get answered by a search.

String RegEx'ing can be very hard for some people. And what would he have searched for?

"^([\/\-]s[\|])[a-zA-Z0-9]$ "?

Give him a break. Seriously...

RegEx questions can be broken up into an actual question or description of the issue you are having.

There are 2 options when posting a new thread.

1. Title

2. Description

So a title example could be:

Title: StringRegExp

Description: Issue capturing all characters after found sub string.

Now to be honest, if he only wants characters a-zA-Z0-9 he was real close

^([\/\-]s[\|])[a-zA-Z0-9]$
should have been
^-s\|[a-zA-Z0-9]+$
He was only missing the "+" sign. Or he could even do:
^-s\|(\w+)

I wouldn't use .*? is because * says that there may or may not be any value after -s| and it will still return an array, and "." says "any character" and the OP is shows they only want word characters.

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.

Posted (edited)

We're sorry. I described the question of translation from google

$aArray=StringRegExp("/s|564564test|sdf12345","^\/s\|(.*)\|(.*)$",1)

MsgBox(0,"test",$aArray[0])

Continue to ask, I need to return to:

564564test|sdf12345

Edited by sanhen
  • Moderators
Posted (edited)

We're sorry. I described the question of translation from google

$aArray=StringRegExp("/s|564564test|sdf12345","^\/s\|(.*)\|(.*)$",1)

MsgBox(0,"test",$aArray[0])

Continue to ask, I need to return to:

564564test|sdf12345

If you continue to change the parameters of your question... you may never find an answer. Providing as much pertinent information as possible (Like what you actually want) is what gets people what they actually need.

^/s\|(\w+\|\w+)\z

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.

Posted

$aArray=StringRegExp("/s|pass1234|\\server","^/s\|(\w+\|\w+)",3)

MsgBox(0,"test",$aArray[0])

F:\tools\AutoIt\?????\?? AutoIt v3 Script.au3 (4) : ==> ???????????.:

MsgBox(0,"test",$aArray[0])

MsgBox(0,"test",$aArray^ ERROR

  • Moderators
Posted (edited)

$aArray=StringRegExp("/s|pass1234|\\server","^/s\|(\w+\|\w+)",3)

MsgBox(0,"test",$aArray[0])

F:\tools\AutoIt\?????\?? AutoIt v3 Script.au3 (4) : ==> ???????????.:

MsgBox(0,"test",$aArray[0])

MsgBox(0,"test",$aArray^ ERROR

Come on now. That's rediculous. You should go download RegExBuddy or RegExCoach and learn some regex before even trying it.

^/s\|(.+?\|.+?)\z

You were only ever looking for word characters, now you're saying it can be any character.

You always error check as well.

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.

Posted

thanks.I will try to resolve this. This is the code.

$aArray=StringRegExp("/s|pass1234|\\server","^/s\|(.*\|.*)",3)

MsgBox(0,"test",$aArray[0])

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...