Filter REGEX in SDO_RDF_MATCH

Hello;
I want to know how to use the regex, like or similar under the SDO_RDF_MATCH. I only see examples with simple conditions 'h < 5' etc..
Regards
Isidro

Hello;
I think it so, but the question is about the last parameter 'filter condition' of SDO_RDF_MATCH.
1.- If you work with namespaces, you cannot tell directly about elements in them,.. well, without using regular expressions.
In your example;
SELECT x Male
FROM TABLE(SDO_RDF_MATCH( '(?x rdf:type :Male)',
SDO_RDF_Models('family'),
null, SDO_RDF_Aliases(SDO_RDF_Alias('','http://www.example.org/family/')), null)) WHERE x LIKE '%T%';
if this alias the preffix, 'family'
<b>SDO_RDF_Alias('family','http://www.example.org/family/'</b>
in this <b>WHERE</b> you cannot express the clause <b>LIKE 'family:Jo' </b> because out of this query the result is
http://www.example.org/family/John
2.- The FILTER parameter is in most cases however it is more efficient to include it as part of SDO_RDF_MATCH SDO_RDF_MATCH what arguments can be filtered?
3.- Then, I tell again the question, Can I use the clause LIKE of similar into SDO_RDF_MATCH to filter string based results.
Best
Isidro

Similar Messages

  • Filter Strings using regular expressions

    Requirements.
    1.I have a table with different names.
    2.I input a word(string) through a text box.
    3.I filter table using the input string through text box using the code
    ((DefaultRowSorter)table_customer.getRowSorter()).setRowFilter(RowFilter.regexFilter(regex, indices));
    4.regex is obtained as follows.
    String regex = "";
    String text = txtFilterText.getText();
    regex = "^(?i)"text".*"; //for starts with filter
    regex = "." + text + ".";//for contains filter
    regex = "(?i)["text".*]";//for doesnt start with filter
    regex =".*(?i)"text"$";//for end with filter
    I need help for doesnt contain and doesnt end with filters.Plz help me out..
    Anees

    h2. {color:ff0000}Double post{color}
    Reply here: http://forum.java.sun.com/thread.jspa?threadID=5231406

  • Mail subject rewriting when sent to DL- Exchange 2010

    Hi folks,
    we have an Exchange 2010 and several DL.
    We'd like to rewrite the subject of any message sent to a specific DL to ease the filtering of such messages (seen Outlook client is limited in filtering).
    Any of the rules as described here don't apply
    http://technet.microsoft.com/en-us/library/dd638183(v=exchg.141).aspx
    I'm pretty familiar with regular expression but last time I used the mail header to catch the condition I ended up in rewriting any message sent through Exchange.
    I think this is a pretty basic function and I wonder why it's not among the offered filter options.
    Has any one done that before and could he/she recommend the filter/regex to use? I guess it would be "Mail to:.*[email protected]" but as I said last time message other messages were impacted (they were messages on other DL that didn't have such
    pattern in the headers as far as I remember)
    Thanks in advance,
    Alex

    Hi Anand,
    thanks for your reply but I'm afraid it doesn't apply to my case. The question is to rewrite the Subject when a message is sent to the DL regardless of who sends it (the DL might be opened in the future to external addresses as well)
    Let's say that the DL My-favourite-recipies at example.com is the DL and this DL has got users A,B,C,D and E.
    My understanding is that what you propose will work even in case the user A will send a private email to user E because both belong to the DL, and on top of it the management by the moderator, that is not set, is not necessary. 
    That's why I'm looking for the solution in the headers (since I didn't see the option "sent to DL xxxx") "IF destination email address is my-favourite-recipies at example.com" then "prepend the Subject with [My-favourite-recipies]"
    I have to say that I'm not aware how Exchange treats messages sent to DLs and I though it was sufficient to set the condition to the field "RCPT TO:" but unfortunately mails to other DLs were affected.
    Let me be more specific: we have a DL called waw-200 at example.com (of course I modified the domain)
    and when setting the condition for such DL I used the following (W|w)(A|a)(W|w)-200 at example.com but in this way also mails sent to DLs like fps-it at example.com were touched.
    Thanks Alex

  • Observing poor performance on the execution of the quereis

    I am executing a relatively simple query which is rougly taking about 48-50 seconds to execute. Can someone suggest an alternate way to query the semantic model where we can achieve response time of a second or under. Here is the query
    PREFIX bp:<http://www.biopax.org/release/biopax-level3.owl#>
    PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
    PREFIX ORACLE_SEM_FS_NS:<http://oracle.com/semtech#dop=24,RESULT_CACHE,leading(t0,t1,t2)>
    SELECT distinct ?entityId ?predicate ?object
    WHERE
    ?entityId rdf:type bp:Gene .
    ?entityId bp:name ?x .
    ?entityId bp:displayName ?y .
    ?entityId ?predicate ?object .
    FILTER(regex(?x, "GB035698", "i")||regex(?y, "GB035698", "i"))
    Same query executed from sqldeveloper takes about as long as well
    SELECT distinct /*+ parallel(24) */subject,p,o
    FROM TABLE
    (sem_match ( '{?subject rdf:type bp:Gene .
    ?subject bp:name ?x .
    ?subject bp:displayName ?y .
    ?subject ?p ?o
    filter (regex(?x, "GB035698", "i")||regex(?y, "GB035698", "i") )
    sem_models ('biopek'),
    null,
    sem_aliases
    ( sem_alias
    ('bp',
    'http://www.biopax.org/release/biopax-level3.owl#'
    NULL,
    null,null ))
    Is there anything I am missing, can we do anything to optimize our data retrieval?
    Best Regards,
    Ami

    For better performance when using FILTER involving regular expression, you may want to create a full-text index on MDSYS.RDF_VALUE$ table as described in:
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e11828/sdo_rdf_concepts.htm#CIHJCHBJ
    I am assuming that you are checking for case-insensitive occurrence of the string GB035698 in ?x or ?y. (On the other hand if you are checking if ?x or ?y is equal to a case-insensitive form of the string GB035698, then the filter could be written in an expanded form involving just value-equality checks and would not need a full-text index for performance.)
    Thanks.

  • Problem with regex being used to filter filenames ...

    I wrote a simple FilenameFilter that takes a regular expression (String) in it's constructor. It uses that regex to determine which files to return when a directory is read using the listFiles(FilenameFilter) syntax.
    The problem I'm having is probably with my regex. If I use a regex like ".*[.]xml", the filter appears to work as I would expect: I get only files that end in XML.
    If on the other hand I try to do a little more complex regex to get all the files that don't end in ".xml", it seems to match everything.
    In my code, I am doing the following:
                    // Only deal with files that don't end in XML
                    fileList = dir.listFiles(new RegexFilenameFilter(".*[.](?!xml).*$"));Where I'm using the regex ".*[.](?!xml).*$", which should match any string that doesn't end with .xml.
    My RegexFilenameFilter follows:
    * RegexFilenameFilter.java
    * Created on May 26, 2006, 10:27 AM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package com.jmmdhs.util;
    import java.io.File;
    import java.io.FilenameFilter;
    import java.util.regex.Pattern;
    import org.apache.log4j.Logger;
    * Regular Expression FilenameFilter - allows filtering directory by regex.
    public class RegexFilenameFilter implements FilenameFilter {
        private static final Logger logger = Logger.getLogger(RegexFilenameFilter.class);
        private String patternString = null;
        private Pattern regexPattern; 
         * Constructor that takes a String containing the regex for matching
         * @param regexString Regular expression string.
        public RegexFilenameFilter(String regexString) {
            logger.debug("Constructing RegexFilenameFilter with expression '" + regexString + "'");
            patternString = regexString;
            regexPattern = Pattern.compile(patternString);
         * Method returns true if the pattern matches.
         * @param directory Directory to match
         * @param fileName Name of the file to match
         * @return Boolean indicating match.
        public boolean accept(File directory, String fileName) {
            return regexPattern.matcher(fileName).matches();     
    }

    public static void main(String args[])
            ArrayList<String> al = new ArrayList<String>();
            al.add( "sfsd.txt" );
            al.add( "dfde.doc" );
            al.add( "sfsd.xml" );
            al.add( "sfsd.txt" );
            al.add( "win.xml" );
            Iterator i = al.iterator();
            while ( i.hasNext() )
                String s = (String) i.next();
                if ( s.endsWith( ".xml" ) )
                    System.out.println( s );
        }

  • Regex pattern, filter delimiter in sql code

    Hi,
    The problem I'm having is that the regex pattern below is not catching the beginning "go" and ending "go" of a string.
    "(?iu)[(?<=\\s)]\\bgo\\b(?=\\s)"
    The idea is catching the "whole word", in this case the word is "go" so if the word is at the beginning of the string or at the end, i still want to include it.
    So, for example:
    "go select * from table1 go" -> should catch 2 "go"s but catches 0
    "go go# select * from table1 --go go" -> should also catch 2 "go"s but catches 0
    "go go select * from table1 go go" -> should catch 4 "go"s but catches 2
    I have the "[(?<=\\s)]" and the "(?=\\s)" so that the word "go" when next to a special character is not included, for example "--go".
    The problem is that this also negates the beginning and ending of the string.
    Code to test example: It should split at 1st, 2nd and last "go", but only splits at the 2nd "go".
    String s = "go go select * from table1 --go go";
    String delimiter = "go";
    String[] queries = s.split("(?iu)[(?<=\\s)]\\b" + delimiter + "\\b(?=\\s)");
    for (int i = 0; i < queries.length; i++) {
         System.out.println(queries[i]);
    I really need to fix this but I'm not having much success.
    Any help will be appreciated, thanks in advance.

    Yes,
    I prefer this one: Regex Powertoy (interactive regular expressions)
    It's not 100% perfect, but you can see with my example and this online tester that the 1st "go" is not matched. And this is a problem for me.
    I want to eliminate the special characters like "#go" or "-go" but i don't want to eliminate the end and start of string.

  • Filting html tags, css, and javascript with regex

    hi everyone,
    im writing a small application where a user types in a url, and the text of the webpage is displayed in a text area.
    ive got it to work, however it takes some time, and also alot of content i dont want is displayed - tags, scripts and sometimes css.
    initally i filtered out the html tags with a regular expression, but i still get alot of unwanted content.
    im not a confident java programmer, and the idea of parsing html, css and javascript is the scariest idea ever to me, so my next idea is to keep only everything between the <body> tags - everything above and below it is deleted - hopefully that should leave me only with the visible content on the site.
    ive messed around with regular expressions but i cant get it to work, can anyone help out?
    thanks alot,
    Torre

    Darryl.Burke wrote:
    I tried out the regexes I posted on the source of a forum page, which is not valid html (contains two each opening and closing body tags). With a bit of trial and error I was able to remove everything upto the first, and not the second, opening tag by using a reluctant qualifier, ^.*?, but couldn't for the life of me achieve removal of only the last closing tag, leaving the other, invalid one intact. How would you do that?Regexes always try to match the first occurrence of whatever they're looking for (the sentinel), and there's no way to change that behavior (but it would be handy if you could). What you have to do instead is make sure the rest of the regex can't match the sentinel. For that you need lookahead, and the simplest way to use it is to scan the rest of the text looking for the sentinel and, if it doesn't find one, go ahead and gobble up the remaining text: "(?is)</body>(?!.*</body).*$" However, if there are many occurrences of the sentinel, you could take a serious performance hit. Here's a much more efficient way: "(?is)</body>(?:[^<]++|<(?!/body>))*+$" After matching the sentinel, this regex gobbles up anything that's not the first character of the sentinel, or the first character as long as it isn't followed by the remaining characters of the sentinel. The advantages of this regex are that it never has to backtrack, and the lookahead is only applied when it's necessary, where the first regex applies it every time.

  • Reject mails content filter based (regex)

    How can I reject incoming mails based on a regex?

    Rejecting incoming emails where the envelope sender is in your own domain can help but if you have any roaming users it will likely end up being a problem unless they always connect over VPN. My experience has been that they will often try to use other ways to send email even if just as an expedient.
    You absolutely can reject spoofed envelope senders but these are based on basic rules rather than a regex. From the GUI menu select Mail Policies -> Mail Flow Policies and you can edit the settings for each mail flow policy. Each policy has a section at the bottom called "Sender Verification."
    You can reject based on three main criteria. The appliance does a DNS lookup on the domain in the envelope sender and can take action based on this.
    1) Malformed or partial envelope sender
        Example: Just a username with no domain at all
    2) Envelope senders where the domain does not resolve
       DNS returns temporary error. Could be all their DNS servers are unreachable.
       The appliance defaults to a 4xx 'try later' response.
    3) Envelope senders where the domain does not exist
        DNS returns NX Domain/Perm fail. Like if the roots say the domain does not exist.
        The appliance defaults to a 5xx "perm fail" response.
    I have tried for years to get Cisco/Ironport to add options where the MX resolves to something ridiculous like 127.0.0.1 or 1.1.1.1 but that has never flown since it would involve interpreting a DNS lookup versus just a go/no go result.Even just the three cases there are now can make a huge difference.
    Anyway, check the section titled "Sender Verification: Envelope Sender" in the AsyncOS configuration guide.for more information on these settings.
    The Advanced Configuration Guide details a fairly new feature (for Ironport) called SMTP Call-Ahead. It can go further by looking up the full email address but make sure that you understand the implications of this as it can result in your mail server being seen as doing excessive lookups and getting blocked, or worse, a DOS attack.

  • How can I create a filter for an exact set of characters?

    Hello! I am setting up a filter to catch messages with GG in the subject. Sometimes this will be at the beginning of the subject (no space at the front) and other times it will be somewhere in the middle. The problem I'm having is that this filter catches any word with "gg" in it, like "logged" or "baggage" (one of my customers has baggage in their name, but their messages should not be caught by this filter). How can I make this work? Thank you for your time!

    I think FiltaQuilla might be useful. It adds so-called Regular Expressions to the filter system, where you could use a construction like:
    "subject regex" "matches" "/\bgg\b/i"
    \b means a word boundary
    gg is your two letters
    \b is the trailing word boundary
    / and /i mean ignore the case, so it'll find gg, GG, Gg and gG.
    There lots of ways of doing this. You could have
    [ ]GG[ ]
    where it would require a space (explicitly; nothing else!) before and after, and capital letters. \b is usually superior as it matches at the beginning and end of the line, and recognizes regular punctuation in addition to spaces.

  • Can I filter the table being profiled in the Data Profiling task, or know of a work around? SSIS2008r2

    Hi,
    I import several files into a staging table.  Inside a foreach loop, after the data flow task I have a Data Profiling task that profiles the table so we can give feedback to those who sent us the file.
    I just relalized that after the first loop, there is more than one file in the staging table, hence more than one file is being profiled.
    At first glance it doesnt appear I can add a "Where" clause to the table.  I do have a column that states which file the data came from, but with only being able to profile a view or table, I can't filter.
    Anyone have any ideas?
    Mike

    Catching outliers seeing how much of what kind of data exist, deviations, distribution, you get some sort of a historgram in essence with the Data Profiling.
    It is normally a preamble to doing data ingress (or egress) into a new target.
    Now patterns are in Fuzzy Lookups/matching or grouping. Having RegEx used is hard in SSIS! I admit, I proposed to have it included into SSIS VNext. I remember there was a component or two on CodePlex:
    http://ssisctc.codeplex.com/ see if any makes sense, I recall I tried one just out for fun.
    Arthur My Blog

  • How to set numeric filter for JSpinner?

    Hi there,
    I searched the forum but can't find a solution...I'm kind of getting mad!
    Problem is: I have a JSpinner, I must prevent the user to insert any non-numeric value. the accepted input should be in the form <n>.<m>
    where n could be any integer number, m is OPTIONAL and could be a single digit number. Example: 150.2 or 41 or 7.1 etc.
    I set a DocumentFilter on the editor of JSpinner, overriding replace method. Problem is replace method is never called so my filter is not applied and the user is allowed to insert whatever he wants, characters included.
    Here's my code (sorry for the horrible gui, but it's just for some testing.):
    import java.awt.Dimension;
    import java.util.regex.Pattern;
    import javax.swing.JFrame;
    import javax.swing.JSpinner;
    import javax.swing.JTextField;
    import javax.swing.SpinnerNumberModel;
    import javax.swing.JSpinner.NumberEditor;
    import javax.swing.text.AbstractDocument;
    import javax.swing.text.AttributeSet;
    import javax.swing.text.BadLocationException;
    import javax.swing.text.DocumentFilter;
    public class SpinnerTry {
         public final static String REGEX_DOUBLE_NUMBER = "^([0-9]+)(\\.(\\d{1})?)?$";
         private static final Double MIN_PW = 12.0;
         private static final Double MAX_PW = 19.0;
         private static final Double DEFAULT = 15.0;
         private static final Double STEP = 1.00;
         private static final SpinnerNumberModel model = new SpinnerNumberModel(
                   DEFAULT, // initial value
                   MIN_PW, // min
                   MAX_PW, // max
                   STEP);
         public static void main(String[] args) {
              JFrame frame = new JFrame();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JSpinner spinner = new JSpinner(model);
              spinner.setPreferredSize(new Dimension(50, 15));
              NumberEditor edit = new NumberEditor(spinner, "#######.#");
              spinner.setEditor(edit);
              JTextField textField = ((JSpinner.DefaultEditor) spinner.getEditor()).getTextField();
              ((AbstractDocument) textField.getDocument()).setDocumentFilter(new MyDocumentFilter());
              frame.getContentPane().add(spinner);
              frame.setSize(new Dimension(200, 200));
              frame.setVisible(true);
         static class MyDocumentFilter extends DocumentFilter {
              public void replace(FilterBypass fb, int offset, int length, String text,
                        AttributeSet attrs) throws BadLocationException {
                   System.out.println("Called replace");
                   String mytext = fb.getDocument().getText(0, offset);
                   mytext += text;
                   if (fb.getDocument().getLength() - 1 > offset) {
                        mytext += fb.getDocument().getText(offset + 1,
                                  fb.getDocument().getLength() - offset);
                   boolean ok = true;
                   ok = Pattern.matches(REGEX_DOUBLE_NUMBER, mytext);
                   if (ok)
                        super.replace(fb, offset, length, text, attrs);
              public void insertString(FilterBypass fb, int offset, String string, AttributeSet attr)
                        throws BadLocationException {
                   if (Pattern.matches(REGEX_DOUBLE_NUMBER, string)) {
                        super.insertString(fb, offset, string, attr);
    }Why replace method is not called when inserting somethig into the spinner text field?
    Thanks a lot in advance.
    Paul
    Edited by: the.paul on Jul 27, 2010 1:11 AM

    I found a solution, got inspiration from [http://forums.sun.com/thread.jspa?forumID=57&threadID=5424330] .
    Code:
    import java.awt.Dimension;
    import java.text.DecimalFormat;
    import java.text.NumberFormat;
    import java.util.regex.Pattern;
    import javax.swing.JFrame;
    import javax.swing.JSpinner;
    import javax.swing.SpinnerNumberModel;
    import javax.swing.JSpinner.NumberEditor;
    import javax.swing.text.AttributeSet;
    import javax.swing.text.BadLocationException;
    import javax.swing.text.DefaultFormatterFactory;
    import javax.swing.text.DocumentFilter;
    import javax.swing.text.NumberFormatter;
    public class SpinnerTry {
         public final static String REGEX_DOUBLE_NUMBER = "^([0-9]+)(\\.(\\d{1})?)?$";
         private static final Double MIN_PW = 12.0;
         private static final Double MAX_PW = 19.0;
         private static final Double DEFAULT = 15.0;
         private static final Double STEP = 1.00;
         private static final SpinnerNumberModel model = new SpinnerNumberModel(
                   DEFAULT, // initial value
                   MIN_PW, // min
                   MAX_PW, // max
                   STEP);
         public static void main(String[] args) {
              JFrame frame = new JFrame();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JSpinner spinner = new JSpinner(model);
              spinner.setPreferredSize(new Dimension(50, 15));
              String decimalFormatPattern = "#######.#";
              NumberEditor edit = new NumberEditor(spinner);
              spinner.setEditor(edit);
              ((NumberEditor) spinner.getEditor()).getTextField().setFormatterFactory(
                    new DefaultFormatterFactory(new MyListFormatter(model, new DecimalFormat(decimalFormatPattern))));
              frame.getContentPane().add(spinner);
              frame.setSize(new Dimension(200, 200));
              frame.setVisible(true);
         static class MyListFormatter extends NumberFormatter {
              private static final long serialVersionUID = -790552903800038787L;
              private final SpinnerNumberModel model;
              private DocumentFilter filter;
              MyListFormatter(SpinnerNumberModel model, NumberFormat format) {
                   super(format);
                   this.model = model;
                   setValueClass(model.getValue().getClass());
              public void setMinimum(Comparable min) {
                   model.setMinimum(min);
              public Comparable getMinimum() {
                   return model.getMinimum();
              public void setMaximum(Comparable max) {
                   model.setMaximum(max);
              public Comparable getMaximum() {
                   return model.getMaximum();
              protected DocumentFilter getDocumentFilter() {
                   if (filter == null) {
                        filter = new MyDocumentFilter();
                   return filter;
         static class MyDocumentFilter extends DocumentFilter {
              public void replace(FilterBypass fb, int offset, int length, String text,
                        AttributeSet attrs) throws BadLocationException {
                   System.out.println("Called replace");
                   String mytext = fb.getDocument().getText(0, offset);
                   mytext += text;
                   if (fb.getDocument().getLength() - 1 > offset) {
                        mytext += fb.getDocument().getText(offset + 1,
                                  fb.getDocument().getLength() - offset);
                   boolean ok = true;
                   ok = Pattern.matches(REGEX_DOUBLE_NUMBER, mytext);
                   if (ok)
                        super.replace(fb, offset, length, text, attrs);
              public void insertString(FilterBypass fb, int offset, String string, AttributeSet attr)
                        throws BadLocationException {
                   if (Pattern.matches(REGEX_DOUBLE_NUMBER, string)) {
                        super.insertString(fb, offset, string, attr);
    }That is: define a custom formatter ; the formatter uses the custom DocumentFilter.
    Hope it is useful for some people out there.
    Regards

  • In a filter, I need don't want to use match but contains

    So I will keep this simple
    function ffBuck(ds, row, index){
    return (row.Watershed.match("Buck")) ? row : null;
    That works great when Watershed = "Buck but what if Watershed ="Buck Salt and Red Creeks"
    I don't know too much javascript to do a string search and return. Any thoughts?
    Thanks for the help in advance,
    Jon

    Gramps,
    Thanks for the link. It isnt do what I want it to do but it is a helpful link for the future. I think in fact that the match javascript method is doing what I want it to do.
    Lets say that row.Watershed = "Buck and White Creek". That row is an indicator of what watershed a specific document is for. The are filtering through a large dataset of docs in an xml file. In that example the document is about two watersheds, Buck and White.
    I have a bunch of checkboxs with filters applied. If they click on the Buck Creek checkbox to see those documents for Buck Creek I fire the filter:
    function ffBuck(ds, row, index){
    return (row.Watershed.match("Buck")) ? row : null;
    My question was concerning how the match worked. I know that it would work if row.Watershed="Buck" but didnt know if the match wanted an exact match of "Buck" or whether it was finding any instance of "Buck" in the row.Watershed. If it wants a match, then I assume this means I have to write a regEx that tells it to look for any instance of Buck.
    Does that make sense? Thanks for your help.

  • Anti-relay filter configuration issues

    Configuration issues with the anti-relay filter in Messaging Server 4.1x.
    The following information addresses common questions about configuration issues
    with the anti-relay filter in Messaging Server 4.1x:<BR>
    <P>
    <OL>
    <LI><B>Question:</B><BR>
    What is the difference between the delivery
    and submission
    options?<BR>
    <P>
    <B>Answer:</B><BR>
    The submission option
    allows specified users to send email to any email address in the world.
    These users are typically internal users.
    <P>
    The delivery option
    allows specified users to receive email from anybody. These users
    are also typically internal users.
    <P>
    A standard filter will appear something as follows:<BR>
    <P>
    # This is the anti-relay config file written by Jay at iPlanet
    # The first section sets default conditions
    resolvehostnames:0
    useauthinfo:0
    advertiseauthinfo:1
    # This section sets domains to be delivered to by anybody
    delivery:*@my.domain.com
    # This section sets domains that can send any place
    submission:129.12.4.*
    <P>
    <P>
    <LI><B>Question:</B><BR>
    The delivery
    option works properly. However, why doesn't the
    submission option
    appear to be allowing emails from specified users to pass through?
    <P>
    <B>Answer:</B><BR>
    The problem with the submission behavior could be due to the setting of the
    the resolvehostnames
    parameter. If this parameter is turned on
    (resolvehostnames:1),
    then <I>all</I> entries in this configuration file must be fully qualified
    host names. Although wildcards will work, you cannot specify IP
    addresses with this configuration setting.
    <P>
    <P>
    <LI><B>Question:</B><BR>
    Is it possible to allow people outside of my network to connect to the server
    and send mail out?
    <P>
    <B>Answer:</B><BR>
    Yes. To allow outside users to connect to the server and send mail
    to any address, without granting the same privilege to the rest of the world,
    activate the authenticated SMTP portion of the filter via the
    useauthinfo option.
    Setting this parameter to "1" (i.e., useauthinfo:1
    ) will require a user who is not in a
    submission address and who is attempting to send email to an address not in
    the delivery range to authenticate with a user ID and password.
    </OL>
    <P>
    For additional information on the anti-relay filter, please refer to the
    Messaging Server 4.1 Administrator's Guide at<BR>
    <P>
    http://docs.iplanet.com/docs/manuals/messaging/nms41/ag/ubefiltr.htm#1073677

    Prashant:
    Are you using a UBE filter to configure domain-based anti-relayinging? We had better luck with the anti-relay plug-in. There is some info on this (for 4.15) at
    http://docs.sun.com/source/816-6044-10/ubefiltr.htm#1069973
    You have to enable the plug-in using configutil, per the above. The anti-relay plug-in is controlled by antirelay.conf. Be aware that the pattern matching rules are very limited, and not well documented. Fortunately, the source code to the plug-in is included, and you can see what it is doing. To pass the tests we had to add a hard-coded test for a "%" in the source and recompile:
    *** antirelay.c.orig Thu Oct 31 04:42:13 2002
    --- antirelay.c Thu Oct 31 04:22:07 2002
    *** 934,939 ****
    --- 934,940 ----
    * Weight must be non-zero to begin with so that matches on just "*"
    * will work.
    + if( strchr(text,'%') != NULL ) return ABORT;
    weight = TRUE;
    for ( ; *p; text++, p++) {
    if (*text == '\0' && p != '')
    Not a really elegant hack, but we didn't need a fully functional regex engine.

  • Regex and implementing FilenameFilter problem

    Hello,
    So what I'm trying to do is to create a program that takes a certain set of files, pulls the first line of each file and uses it to name the file. Right now, I'm at the point of getting a listing of files based on a patterns. So when I run the program on the command line (of a windows machine), it spit out the files that I'm looking for. Something like:
    java FileRenamer *.txt
    Above should produce a listing of only files that have .txt on them (I want to have the capability to choose *.txt or whatever other combination of pattern match).
    To do the above, I want to use a FileNameFilter interface to figure out what files match. The problem that I'm running into is that when I run a unit test against the getFilesListBasedOnPattern method, I get:
    java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0
    *.txt
    The problem is that the *.txt has a regex character (the *) and I'm not sure how make it behave like the wildcard in the dos command line where *.txt means everything that has .txt at the end.
    The code listing is below. Does anyone have any suggestions on how to best approach this?
    mapsmaps
    =======> Code below <=======
    // unit test snippet that causes blow out:
    FileRenamer fr = new FileRenamer();
    String [] strArrFilesBasePattern = fr.getFilesListBasedOnPattern(dirTestFiles,"*.txt");
    ====
    //main program
    package com.foo.filerenamer;
    import java.io.File;
    import java.io.FilenameFilter;
    import java.util.Vector;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    * TODO Use regexp to filter out input to *.txt type of thing or nothing else
    public class FileRenamer
        // Vallid file patterns are *.*, ?
        public static final String strVALIDINPUTCHARS = "[_.a-zA-Z0-9\\s\\*\\?-]+";
        private static Pattern regexPattern = Pattern.compile(strVALIDINPUTCHARS);
        private static Matcher regexMatcher;
         * @param args
         * @throws InterruptedException
        public static void main(String[] args) throws InterruptedException
            int intMillis = 0;
            if (args.length > 0)
                try
                    intMillis = Integer.parseInt(args[0]);
                    System.out.println("Sleep set to " + intMillis + " seconds");
                catch (NumberFormatException e)
                    intMillis = 5000;
                    System.out.println("Sleep set to default of " + intMillis + " since first parameter was non-int");
                for (int i=0;i<args.length;i++)
                    System.out.println("hello there - args["+i+"] = "+ args);
    Thread.sleep(intMillis);
    // TODO Auto-generated method stub
    public boolean checkArgs(String [] p_strAr)
    boolean bRet = false;
    if (p_strAr.length != 1)
    return false;
    else
    regexMatcher = regexPattern.matcher(p_strAr[0]);
    bRet = regexMatcher.matches();
    return bRet;
    public String[] getFilesListBasedOnPattern(File p_dirFilesLoc, String p_strValidPattern)
    String[] strArrFilteredFileNames = p_dirFilesLoc.list(new RegExpFileFilter(p_strValidPattern));
    return strArrFilteredFileNames;
    class RegExpFileFilter implements FilenameFilter
    private String m_strPattern = null;
    private Pattern m_regexPattern;
    public RegExpFileFilter(String p_strPattern)
    m_strPattern = p_strPattern;
    m_regexPattern = Pattern.compile(m_strPattern);
    public boolean accept(File m_directory, String m_filename)
    if (m_regexPattern.matcher(m_filename).matches())
    return true;
    return false;

    I am doing something similar but have a problem with Java automatically converting wildcards in path-arguments to the first match (!).
    It seems the JVM is applying some intelligence here and checks if a path is passed to main() and if so, it automatically resolves wildcards (also quotes are escaped/resolved), which is pretty annoying and not what I want, since I do never see the original parameters this way:(
    Is there a way to get the original parameters without the JVM intervening / "helping"?
    Any help would be appreciated, as I want my utility to act just like any other shell-program...

  • SDO_RDF_MATCH what arguments can be filtered?

    Hi,
    Another problem I have is filtering of various type of data with SDO_RDF_MATCH function. How for example text or data can be filtered? Is there any documentation about capabilities of this function's filter?
    Thanks for answer.

    One example is the one you posted at problem with SDO_RDF_MATCH filter
    The filter can also be used outside of SDO_RDF_MATCH, in the WHERE clause of the enclose SELECT statement (in most cases however it is more efficient to include it as part of SDO_RDF_MATCH):
    SELECT m, h
    FROM TABLE(SDO_RDF_MATCH(
    '(?m rdf:type :Male) ( ?m :height ?h )',
    SDO_RDF_Models('family'),
    NULL,
    SDO_RDF_Aliases(SDO_RDF_Alias('','http://www.example.org/family/')),
    NULL))
    where h >= 6;
    Melli

Maybe you are looking for

  • Issues with Firefox hogging resources...

    I have several issues with Firefox intermittently consuming 99-100% of my CPU memory. Now, let me preface this by saying that I am NOT an advanced user, and can only tell you what I see on things like the Task Manager and such. Furthermore, I know th

  • Patch file for update Adobe Acrobat 9 standard

    Hello PCs in our company using Adobe Acrobat 9 standard. This application is installed on WinXp Japanese. I read from http://www.adobe.com/support/security/bulletins/apsb09-10.html request for Adobe Acrobat Standard and Pro 9.1.2 and earlier - Window

  • HT4097 iTunes keeps crashing when i try to restore iPad!!! help!!

    I've been trying for the past 4 hours to restore my ipad and everytime i do this iTunes keeps crashing once it has extracted my software, it says itunes has stopped working and i need to close the program down! i am completly lost as i know nothing a

  • How do I rotate a Numbers spreadsheet for vertical printing?

    Have a mental block on this one. Can't believe its not blindingly obvious! But how do I rotate a spreadsheet to vertical so it will fit an A4 sheet in one piece?

  • Is it possible to lock individual text messages to prevent deletion?

    Is there a way to lock an indiviual text message (iMessage) and prevent it from being deleted when the rest of the thread is deleted?  Sometimes I want to keep certain messages because they are just too funny to get rid of!