You are here: PSPad forum > Developer forum - new builds > 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
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
Posted by: Replace in RegEx not working? | Date: 2005-12-30 09:54 | IP: IP Logged
Yea! You have right I just started to coding in C# but in PSPad it is faster
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')
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 ;)
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