Fanfare Posted April 13, 2011 Report Share Posted April 13, 2011 (edited) Oh cool thanks, that makes a lot of sense now. So I want to strip out the font code and make sure it doesn't match ^. or ^-. Could I do something like: /^##\*.*\*##[^\.^-]/gS You can use regex's negative look ahead: /(?!\.|\^|-)##\*.*\*##/If you mean that you want to ignore both the symbol "^." and "^-." This pattern should do the trick. The dot and the caret symbol are to be escaped because they have special meanings in regex. Edited April 13, 2011 by Fanfare Link to comment Share on other sites More sharing options...
Fanfare Posted April 13, 2011 Report Share Posted April 13, 2011 My bad. I didn't test the regex pattern earlier. I think the edit should work. Link to comment Share on other sites More sharing options...
Guest Travis Posted April 13, 2011 Report Share Posted April 13, 2011 Thanks for your help, I will try it out. Link to comment Share on other sites More sharing options...
Guest Travis Posted April 13, 2011 Report Share Posted April 13, 2011 Alright I tried it but the expressions are $true for any text. What I'm trying to do is convert Supertrivia for chatcore network. Supertrivia has 3 text events and I don't want to take the time to combine them into one text event. I'd like to just make this work how it is. The problem is each text event uses regex to look at the first character of incoming text but this network has a font code for $1. So I need to look at the first character after the font code. The first text event is supposed to check for text that starts with a . only. on $*:text:/^(##\*.*\*##)?(.*)/:#:{ } The second text event is supposed to check for text starting with ! only. on $*:text:%st_filter_cmd:#:{ } %st_filter_cmd = /^(##\*.*\*##)?(!*)/gS The last text event checks for all text that doesn't start with a . or a !. on $*:text:%st_filter_norm:#:{ } %st_filter_norm = /(?!\.|\^|!)##\*.*\*##/gS Can anyone please help me with the proper regex to do these things? Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now