gcue Posted June 1, 2012 Posted June 1, 2012 i am trying to capture "#REO;Cantors-SIM" from this lines of text like this one: G CN=\#REO;Cantors-SIM3 #REO;Cantors-SIM C here is what i have so far and am not sure why its not working $group = StringRegExpReplace($line, ".*5([\S]+)", "") thanks in advance =)
Xenobiologist Posted June 1, 2012 Posted June 1, 2012 Do you some more information? Examples of lines. Shouldn't be that hard to create the correct pattern. Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
gcue Posted June 1, 2012 Author Posted June 1, 2012 (edited) here are more examples... should get #SL Library from G CN=#SL;Library3 #SL;Library C should get RMAD from G CN=RMAD3 RMAD C should get Socket Data Services from G CN=Socket;Data;Services3 Socket;Data;Services C thanks again for your help! Edited June 1, 2012 by gcue
Xenobiologist Posted June 1, 2012 Posted June 1, 2012 (edited) Well, there is no rule, right? a) Get the words between =\ and ; and ; and 3 or C between = and 3 or C c) between = and 3 or C without ; Edited June 1, 2012 by Xenobiologist Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
Bowmore Posted June 1, 2012 Posted June 1, 2012 This will work for all your examples $group = StringRegExpReplace($line, "^.* ([S]+) [S]*$", "1") "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
gcue Posted June 1, 2012 Author Posted June 1, 2012 ur right!! works fantastic i added this also StringReplace($group, ";", " ") thank you very much!
Xenobiologist Posted June 1, 2012 Posted June 1, 2012 I had this $group = StringRegExpReplace($line, ".*?CNW+(.*?)3.*", "$1") Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
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