java regex to exclude specific strings from a larger one -


I have been beaten for the time being against my head: 0-9]? Character sequences, except strings like sin | Cos | Tan etc. After doing my Reggae homework, the following regex should work:

  (? ((Sin | reason | tan))) \ b [az] [0-9]?  

As you see, I'm alternatively using negative letter head - after the non-capturing group ending bracket \ b after < Code> in sin etc. Regex is understandable and in reality I am trying as a target implementation with Reggaebudby and Java and getting the desired results, but it does not work by using Java Matcher and Pattern Objects! \ b

is in the wrong place, it will seek a word boundary which is not sin / cos / tan before But a limit would be after that at the end there would be a letter, so this would be the limit of an end limit, which can not be if the next letter is AZ

Also, exclude the strings like negative attitudes (if this will work) cost , which I'm not sure you want to do is just keyword Are filtered.

>

I recommend:

  \ b (?? sin \ b | cos \ b | tan \ b) [az] + [0- 9]? \ B  

Or, more just, you just \ b [az] + [0-9]? \ B and you can filter the strings later in the keyword list. You do not always have to do everything in regex.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -