You are here: PSPad forum > Developer forum - new builds > PSPad UNICODE 4.5.0 (2173) beta English

PSPad UNICODE 4.5.0 (2173) beta English

Goto Page: Previous1 2 3 4 5

#41 Re: PSPad UNICODE 4.5.0 (2173) beta English

Posted by: pspad | Date: 2005-12-30 09:02 | IP: IP Logged

Replace in RegEx not working? wrote:

> I'm looking for expression
> ^(\d){3}\t
>
> But $1 contains always only 1 - not whole 111 or 112 etc -
> using (\d){3}

You must enclose wholeexpression into brackets:
^(\d{3})\t

Options: Reply | Quote | Up ^


#42 Re: PSPad UNICODE 4.5.0 (2173) beta English

Posted by: galious | Date: 2005-12-30 09:09 | IP: IP Logged


Ok I need to convert it to Inserts with some parent categories like this:
I'm looking for expression
^(\d){3}\t

And I'm replacing using this syntax
INSERT INTO [JobCategories] ([IDJobCategory],[IDParentJobCategory],[Opis]) VALUES ('$1',ReplaceWithParent$1

But $1 contains always only 1 - not whole 111 or 112 etc - using (\d){3}

Try (\d{3}) Now you get exactly 3 digits in $1. Your way will put the 3 digits in $1, $2 and $3.

Martin

Options: Reply | Quote | Up ^


#43 Re: PSPad UNICODE 4.5.0 (2173) beta English

Posted by: Replace in RegEx not working? | Date: 2005-12-30 09:54 | IP: IP Logged

Yea! You have right smiling smiley I just started to coding in C# grinning smiley but in PSPad it is faster smiling smiley

Options: Reply | Quote | Up ^


#44 Re: PSPad UNICODE 4.5.0 (2173) beta English

Posted by: Replace in RegEx not working? | Date: 2005-12-30 10:01 | IP: IP Logged

$1$2$3 not working in (\d){3} - I checked this before my post and this will be the best solution for me

RegEx: ^(\d){3}\t
Replacement: INSERT INTO [JobCategories] ([IDJobCategory],IDParentJobCategory],[Description]) VALUES ('$1$2$3','$1$2','

Results are:

INSERT INTO [JobCategories] ([IDJobCategory],[IDParentJobCategory],[Opis]) VALUES ('1','1','Some desc')

But should be

INSERT INTO [JobCategories] ([IDJobCategory],[IDParentJobCategory],[Opis]) VALUES ('112','11','Some desc')

Options: Reply | Quote | Up ^


#45 Re: PSPad UNICODE 4.5.0 (2173) beta English

Posted by: Replace in RegEx not working? | Date: 2005-12-30 10:13 | IP: IP Logged

^(\d){1}(\d){1}(\d){1}\t

It is solution ;)

Ok - thx anyway!

Kind regards from Poland
Mateusz www.Kierepka.pl ;)

Options: Reply | Quote | Up ^


Goto Page: Previous1 2 3 4 5





Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR