Little help with RegEx again...

General topics related to Rainmeter.

Little help with RegEx again...

November 21st, 2012, 5:16 pm
LeftSide
   [35 posts]

So I have a list

Code: Select all

Work
Work
Fire
Global


And I want just the first letters from each line.

Code: Select all

WWFG


The list is created by a batch script

Code: Select all

echo %1>>


I've tried this

Code: Select all

([a-z])[^\n]+\n*
but it gives me just an F
User avatar

Re: Little help with RegEx again...

November 21st, 2012, 6:59 pm
moshi
   [1851 posts]

try:

Code: Select all

(?siU)(?(?=.)(.))(?(?=.*\n).*\n(.))(?(?=.*\n).*\n(.))(?(?=.*\n).*\n(.))



repeat the

Code: Select all

(?(?=.*\n).*\n(.))

as often as you need.

Re: Little help with RegEx again...

November 21st, 2012, 7:06 pm
LeftSide
   [35 posts]

Thanks. BTW
moshi wrote:repeat the

Code: Select all

(?(?=.*\n).*\n(.))

as often as you need.
In this approach, if I don't know just exactly how many times I need to use it in advance it sometimes gives me nothing at all...


Nvm. It works flawlessly.

Return to “General Discussion”



Who is online

Users browsing this forum: No registered users and 1 guest