I have a script in another editor that I want to get away from, if I can and use RJ Text Ed. But the "deal breaker" is if I can get it to do some conversion.
Say I have this (US dates MM/DD/YYYY):
USER1234 (06/21/2012 02:34:59 PM EST)
XYZ1 (06/21/2012 03:38:14 PM EST)
ABCD (06/22/2012 06:45:05 AM EST)
What I want to do, is for the lines to become:
USER1234 (2012_06_21 1434:59 HOURS ET)
XYZ1 (2012_06_21 1538:14 HOURS ET)
ABCD (2012_06_21 0645:05 HOURS ET)
Just a sampling of the code that works in the other editor is:
UltraEdit.activeDocument.findReplace.replace("^([01][0-9]^)/^([0-3][0-9]^)/^([12][0-9]+^) 04:^([0-5][0-9]:[0-6][0-9]^) PM E[DS]++T", "(^3_^1_^2 16^4 ET)");
No matter what I've tried, and I've tried it for three days, I can't get any REGEX commands to work in RJ Tex Ed. Can anyone help me, PLEASE! This is the only section of the script I've worked on, with no success.
I WOULD PREFER C++ script, but JScript would be acceptable.
Thanks in advance!
REGEX "Problem"
Re: REGEX "Problem"
I don't think you can use regex in scripts, cf. www.rj-texted.se/Forum/viewtopic.php?f=11&t=1981&p=6997 For this matter (I don't mean regex alone) I'm bugging Rickard to give another scripting engine a go.
While with regex you would arrive at your destination faster and more easily, maybe you could inch your way (find left bracket, read 10 next characters, tokenize the string, manipulate chunks to change date format, write down)?
While with regex you would arrive at your destination faster and more easily, maybe you could inch your way (find left bracket, read 10 next characters, tokenize the string, manipulate chunks to change date format, write down)?
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
- Rickard Johansson
- Site Admin
- Posts: 6783
- Joined: 19 Jul 2006 14:29
Re: REGEX "Problem"
Doesn't the "Document.ReplaceAll()" function work? Or do you need another way to do regex search, maybe in a string?
Re: REGEX "Problem"
Fact is, I forgot about Document.ReplaceAll()Rickard Johansson wrote:Doesn't the "Document.ReplaceAll()" function work?

Code: Select all
Document.ReplaceAll("\d", "def", false, false, true);
Code: Select all
Document.ReplaceAll("\\d", "def", false, false, true);
Code: Select all
Document.ReplaceAll("[0-9]", "def", false, false, true);

Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
Re: REGEX "Problem"
No matter what I've tried, and I've tried it for three days, I can't get any REGEX commands to work in RJ Tex Ed. Can anyone help me, PLEASE! This is the only section of the script I've worked on, with no success. the customer does not have to buy any membership plan
Last edited by jony33 on 27 Dec 2021 07:19, edited 1 time in total.
Re: REGEX "Problem"
Could you paste a script sample that doesn't work for you?
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus