I have this line, 83949204LLL.
How do i capture the first 5 numbers into 1 variable, the next 3 numbers into another variable and the next 3 letters into yet another variable. All the numbers and letters can change.
Also, is there a way for a trigger to capture say, the next 100 characters. Or next 20 characters. Instead of next 2 or 3 lines.
trigger and regex help
Re: trigger and regex help
(\d{,5})(\d{,3})(\w{,3})
next x characters:
(.{,x})
change x to a number you wish.
(.{,100})
next x characters:
(.{,x})
change x to a number you wish.
(.{,100})
Re: trigger and regex help
What if its all in the same line?
As in, using the above example.
83949204LLL204charactersworthoftextornumbers
I'll capture 83949, 204, LLL then i wanna capture 204charactersworthoftextornumbers.
It'll all be in 1 line like the above.
So it could be 73848398HHH398charactersworthoftextornumbers, and i'll wanna capture all the 398 characters following the HHH.
As in, using the above example.
83949204LLL204charactersworthoftextornumbers
I'll capture 83949, 204, LLL then i wanna capture 204charactersworthoftextornumbers.
It'll all be in 1 line like the above.
So it could be 73848398HHH398charactersworthoftextornumbers, and i'll wanna capture all the 398 characters following the HHH.
Re: trigger and regex help
Why don't you give me an actual example of what you're trying to do, rather than abstracts?
Re: trigger and regex help
Hmm,
Thanks for your time and help.
In the second line, it's not a typo, sometimes they appear together that way in 1 line.#K%75560007BAE0.00
#K%75560008AAC23:05#K%75560011AAF1.7 days
Thanks for your time and help.
Re: trigger and regex help
All right. What is that? What information are you trying to pull out of it, and why? If I know that, I can come up with the regex.tarrant wrote:Hmm,In the second line, it's not a typo, sometimes they appear together that way in 1 line.#K%75560007BAE0.00
#K%75560008AAC23:05#K%75560011AAF1.7 days
Thanks for your time and help.
How are you going to use the information you get?
Re: trigger and regex help
It is Portal MIP. You can read about it here
I want to capture the info and echo it to different windows/miniconsoles based on the 3 letters preceding the info.
Basically, 75560 is just a random number, 007 is the number of characters that will be sent after the 007, BAE is the kind/type of information sent and 0.00, in this case, is the info sent.#K%75560007BAE0.00
#K%75560008AAC23:05#K%75560011AAF1.7 days
I want to capture the info and echo it to different windows/miniconsoles based on the 3 letters preceding the info.
Re: trigger and regex help
Regex:tarrant wrote:It is Portal MIP. You can read about it here
Basically, 75560 is just a random number, 007 is the number of characters that will be sent after the 007, BAE is the kind/type of information sent and 0.00, in this case, is the info sent.#K%75560007BAE0.00
#K%75560008AAC23:05#K%75560011AAF1.7 days
I want to capture the info and echo it to different windows/miniconsoles based on the 3 letters preceding the info.
Code: Select all
(.{,3})(\d{,5})(\d{0,3})(\w{,3})(.+)
Code: Select all
#K%75560007BAE0.00
matches[1] = #K%75560007BAEBAE0.00
matches[2] = #K%
matches[3] = 75560
matches[4] = 007
matches[6] = BAE
matches[7] = 0.00
Code: Select all
#K%75560008AAC23:05#K%75560011AAF1.7 days
matches[1] = #K%75560008AAC23:05#K%75560011AAF1.7 days
matches[2] = #K%
matches[3] = 75560
matches[4] = 008
matches[6] = AAC
matches[7] = 23:05#K%75560011AAF1.7 days
Re: trigger and regex help
Hmm, what you gave didn't seem to work, so I modified it a little to
However, there is a problem with the second line where the 2 occurences are appearing at the same time, cuz the .* just matches everything. If i remove the (.*) from the trigger, it will match all occurences within the same line properly.
Hmm, is it understandable? Not really sure how to make this clearer.
Code: Select all
#K%\d{5}(\d{3})(\w{3})
I need to capture #K%75560008AAC23:05 and #K%75560011AAF1.7 days separately. I thought the match all option would fix it, but it doesn't seem to work when the code is#K%75560008AAC23:05#K%75560011AAF1.7 days
Code: Select all
#K%\d{5}(\d{3})(\w{3})(.*)
Hmm, is it understandable? Not really sure how to make this clearer.
Re: trigger and regex help
Link to a good PCRE tutorial: http://www.regular-expressions.info/reference.html
Here's a link to the complete pcre manual: http://www.pcre.org/pcre.txt
Here's a link to the complete pcre manual: http://www.pcre.org/pcre.txt