Processing Semicolon
Re: Processing Semicolon
Examples where it doesn't work?
One of my scripts helped you out? Please donate via Paypal
Re: Processing Semicolon
Sure.
Code: Select all
$tk = "(test);";
// step;
$tk = regexreplace("$tk", "chr(59)", ""); //otherwise regexmatches will bitch...
$tk = trim("$tk", eval("chr(59)")); //otherwise regexmatches will bitch...
$tk = trim("$tk", "*;(+)."); //otherwise regexmatches will bitch...
text "no semicolon here?<crlf>$tk";
Power-hungry user!!!
Re: Processing Semicolon
No clue what you're talking about...
Code: Select all
$tk = "(test);";
$tk = regexreplace($tk, ";");
text $tk;
$tk = "(test);";
$tk = trim($tk, ";");
text $tk;
What's that, a regex pattern?"*;(+)."
One of my scripts helped you out? Please donate via Paypal
Re: Processing Semicolon
So it seems I don't understand quoting too.
Removing quotes on "$tk" makes it work.
Thanks very much for your assistance, highend! Soon I'll post the entire script on a new post per your instructions so you can check what improvements can be made, as you suggested on the thanks thread ("I bet that can be done faster xD").
Removing quotes on "$tk" makes it work.
No. Those characters, perhaps more, if present on input make regexmatches throw error messages for each time they happen on a loop. Anyway I'm considering asking a silent mode for cases like these.highend wrote:What's that, a regex pattern?"*;(+)."
Thanks very much for your assistance, highend! Soon I'll post the entire script on a new post per your instructions so you can check what improvements can be made, as you suggested on the thanks thread ("I bet that can be done faster xD").
Power-hungry user!!!
Re: Processing Semicolon
I really cant take it.
Now it's not working again:
Got it.
If copied from forum, it works.
Will attach it in a few secs...
Now it's not working again:
Code: Select all
$tk = "(te);";
step;
$tk = regexreplace($tk, "chr(59)", ""); //otherwise regexmatches will bitch...
$tk = trim($tk, eval("chr(59)")); //otherwise regexmatches will bitch...
$tk = trim("$tk", "*;(+)."); //otherwise regexmatches will bitch...
text "no semicolon here?<crlf>$tk";
If copied from forum, it works.
Will attach it in a few secs...
Power-hungry user!!!
Re: Processing Semicolon
Ehm, removing of quotes around $tk has what to do with this case?
This is just unnecessary quoting, that's all.
This is crap. You're quoting a scripting command which makes it a string, not a command.
This is just unnecessary quoting, that's all.
Code: Select all
$tk = regexreplace("$tk", "chr(59)", "");
These are special characters. They need to be escaped in a regex pattern. A semicolon isn't one of them^^make regexmatches throw error messages
Mine takes 1313 ms to produce the alphabetical sorted list "Abwurf.wav = 1<crlf>..."Soon I'll post the entire script on a new post per your instructions so you can check what improvements can be made, as you suggested on the thanks thread
One of my scripts helped you out? Please donate via Paypal
Re: Processing Semicolon
It's a trick problem. If you bother...
Go here:
http://www1.folha.uol.com.br/mercado/20 ... agem.shtml
Put the text in print preview, copy the whole page;
Paste the content on a notepad window;
Locate "(SP);" on it, copy it and use it as source for "$tk" variable at the posted script (any version).
-regexreplace and trim will not process it!
Go here:
http://www1.folha.uol.com.br/mercado/20 ... agem.shtml
Put the text in print preview, copy the whole page;
Paste the content on a notepad window;
Locate "(SP);" on it, copy it and use it as source for "$tk" variable at the posted script (any version).
-regexreplace and trim will not process it!
Power-hungry user!!!
Re: Processing Semicolon
I agree.highend wrote:Ehm, removing of quotes around $tk has what to do with this case?
This is just unnecessary quoting, that's all.
How do you do the measurement???highend wrote:Mine takes 1313 ms to produce the alphabetical sorted list "Abwurf.wav = 1<crlf>..."
Power-hungry user!!!
Re: Processing Semicolon
Show screenshots of:
Notepad with the selected text that you want to copy
Your text editor after inserting the text
Notepad with the selected text that you want to copy
Your text editor after inserting the text
One of my scripts helped you out? Please donate via Paypal
Re: Processing Semicolon
Code: Select all
$start = now("msecs");
... code to execute ...
$duration = now("msecs") - $start;
text $duration . " msecs";
One of my scripts helped you out? Please donate via Paypal
Re: Processing Semicolon
What?highend wrote: Your text editor after inserting the text
I insert it right into the Run Script dialogue. Once done coding, then I paste both code and processed text into plain text files.
Power-hungry user!!!
Re: Processing Semicolon
tiago wrote:Code: Select all
$tk = "(te);"; step; $tk = regexreplace($tk, "chr(59)", ""); //otherwise regexmatches will bitch... $tk = trim($tk, eval("chr(59)")); //otherwise regexmatches will bitch... $tk = trim("$tk", "*;(+)."); //otherwise regexmatches will bitch... text "no semicolon here?<crlf>$tk";
Code: Select all
$tk = regexreplace($tk, "chr(59)", "");
Anyway, chr() is not needed at all. You can just do
Code: Select all
$tk = regexreplace($tk, ";", "");
$tk = trim($tk, ";");
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
Re: Processing Semicolon
Hello, SammaySarkar!
Thanks for popping up.
I did started with simple'r versions. As they proved to be useless on the input described above I started experimenting.
Try to use the attached zipped .txt as source, thus avoiding the complicated steps I described, and perhaps you can see for yourself.
Thanks for popping up.
Not so fast, pal, not so fast!SammaySarkar wrote:tiago wrote:Code: Select all
$tk = "(te);"; step; $tk = regexreplace($tk, "chr(59)", ""); //otherwise regexmatches will bitch... $tk = trim($tk, eval("chr(59)")); //otherwise regexmatches will bitch... $tk = trim("$tk", "*;(+)."); //otherwise regexmatches will bitch... text "no semicolon here?<crlf>$tk";
What you're trying to do here is asking the script to match the string "chr(59)" in $tk. This could've worked if $tk = "I have chr(59) within me"; . You should not quote function calls when you want to use their return. Use them like this: $v = "prefix" . function() . "suffix";Code: Select all
$tk = regexreplace($tk, "chr(59)", "");
Anyway, chr() is not needed at all. You can just doThis is the FIRST thing you should've tried, before all that eval(), chr() business.Code: Select all
$tk = regexreplace($tk, ";", ""); $tk = trim($tk, ";");
I did started with simple'r versions. As they proved to be useless on the input described above I started experimenting.
Try to use the attached zipped .txt as source, thus avoiding the complicated steps I described, and perhaps you can see for yourself.
- Attachments
-
- Clipboard-20160516.zip
- (7.94 KiB) Downloaded 104 times
Power-hungry user!!!
Re: Processing Semicolon
You said you want to extract the (SP); part and trim it, but since this is already a known static string, there doesn't seem much need for scripting.
How exactly do you want to process that attached text?
How exactly do you want to process that attached text?
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]