August 23rd, 2013, 11:26 PM
FoxReplace (Java) - Need help with script
First of all, I'm sorry if my post is not in the correct "Java" section.
I am using the add-on "FoxReplace" (which uses json files) on Firefox in order to remove/replace occurrences on websites. However, there is a case I cannot solve and I would like to ask for your help.
I need to parse the following line:
"INFO Log - [sys] Area#541185471Character#46545"
I would like to remove "Area#xxxxxxxxx" (where x are random numbers).
If you need any other details, please do not hesitate to ask.
I thank you in advance for your help.
August 26th, 2013, 12:23 PM
var s = "INFO Log - [sys] Area#541185471Character#46545";
var s2 = s.replace(/Area#[0-9]+/, "");
August 27th, 2013, 04:57 AM
Thank you very much for your reply.
Unfortunately, FoxReplace seems to only work with this format:
Do you think there is a way to use this format with the s.string command?
August 27th, 2013, 01:07 PM
I guess you'd use
August 28th, 2013, 01:47 AM
Thank you very very much for your help, it works perfectly!
Now, I just need only one thing to change...
May I ask how can you remove x characters before a word? I tried a few combination based on [0-9-] but it didn't work...
I'm sorry for all the newbe questions and thanks again for your help, you're being very helpful.
August 28th, 2013, 04:24 PM
I don't understand what part of that string you're trying to match.
August 28th, 2013, 04:51 PM
Sorry, I was not really clear indeed.
I would like to match the red part.
August 28th, 2013, 05:25 PM
I guess mods should move this to the regex forum if there is such a thing. Anyway, you wanna match a date like YYYY-MM-DD, then a dot, then some letters, a regex for that could be:
In this case though it's probably enough to just match anything up to the @:
Help yourself out and google some tutorials or whatever on regular expressions. At this point you're not getting anything out of just having me do some for you.
August 28th, 2013, 08:16 PM
Thanks again and have a very nice day/evening.