sanhen Posted September 11, 2008 Posted September 11, 2008 (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 September 12, 2008 by sanhen
oren Posted September 11, 2008 Posted September 11, 2008 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 ...
therks Posted September 11, 2008 Posted September 11, 2008 "-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\|(.*)$ My AutoIt Stuff | My Github
Szhlopp Posted September 11, 2008 Posted September 11, 2008 "-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=) RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+'
sanhen Posted September 11, 2008 Author Posted September 11, 2008 $aArray=StringRegExp("-s|abcde123456","^-s\|(.*)$",3) MsgBox(0,"test",$aArray[0]) Tanks ....very good!
Community On Patrol Posted September 11, 2008 Posted September 11, 2008 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.
Szhlopp Posted September 11, 2008 Posted September 11, 2008 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 问我 不要要求他。 他不知道什么他做着 RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+'
Moderators SmOke_N Posted September 11, 2008 Moderators Posted September 11, 2008 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.
sanhen Posted September 12, 2008 Author Posted September 12, 2008 (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 September 12, 2008 by sanhen
Moderators SmOke_N Posted September 12, 2008 Moderators Posted September 12, 2008 (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|sdf12345If 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 September 12, 2008 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.
sanhen Posted September 12, 2008 Author Posted September 12, 2008 $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
trancexx Posted September 12, 2008 Posted September 12, 2008 You are changing it again. Do you see that? ♡♡♡ . eMyvnE
Moderators SmOke_N Posted September 12, 2008 Moderators Posted September 12, 2008 (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^ ERRORCome 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 September 12, 2008 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.
sanhen Posted September 12, 2008 Author Posted September 12, 2008 thanks.I will try to resolve this. This is the code. $aArray=StringRegExp("/s|pass1234|\\server","^/s\|(.*\|.*)",3) MsgBox(0,"test",$aArray[0])
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now