Jump to content

stringregexp help


Recommended Posts

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 =)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by gcue
Link to comment
Share on other sites

Well, there is no rule, right?

a) Get the words between =\ and ; and ; and 3 or C

B) between = and 3 or C

c) between = and 3 or C without ;

Edited 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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

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