RME Baseline Templates compliance and deploy regular expression

Hi:
I have a large number of 3750 stacks consisting of a variable amount  , from 1 to 6, switches. I need to add to all
FastEthernet interfaces from 2/0/1 to n/0/24 a command , under the interface. That is on the 1st and if only one switch do nothing, and for all other switches, be it 2 or 3 etc switches under each interface add a one line command.
I  have not found the correct syntax to have only the interfaces I need to be effected. For example:
interface [#FastEthernet.*#]   picks all interfaces including the ones on the 1st switch which I don't want to change.
Interface [#fastEthernet[2-9].*#]  ignores all interfaces.
I have tried various forms of syntax for the regular expression   but either hit all interface or none.
Does anyone know how to format the request properly.
Thanks in advance
Mickey

This regexp should work:
interface [#FastEthernet(1[0-9]+|[2-9][0-9]*)/.*#]

Similar Messages

  • Using RME baseline templates to find non-compliant SNMP strings

    Running LMS3.2.1
    A. Can I run a compliance check using RME baseline template to find devices which have non standard SNMP strings IN ADDITION to the correct one?
    How will the regular expression look like if we want to say
    + snmp-server community cisco123 ro
    + snmp-server community cisco456 rw 1
    - snmp-server community [anything else] ro
    - snmp-server community [anything else] rw [#.*#]
    B. Is it possible to run a clean up job on the violating devices by using DEPLOY (or NetConfig, etc.)?

    - [#snmp-server community (?!cisco123|cisco456).*#]
    + snmp-server community cisco123 RO
    + snmp-server community cisco456 RW
      From the compliance job result GUI, you can deploy the job directly after verifying the results.  When you deploy this template, it will remove any community that does not match "cisco123" or "cisco456", and then add them if the device does not already have them.

  • SQL Injection and Java Regular Expression: How to match words?

    Dear friends,
    I am handling sql injection attack to our application with java regular expression. I used it to match that if there are malicious characters or key words injected into the parameter value.
    The denied characters and key words can be " ' ", " ; ", "insert", "delete" and so on. The expression I write is String pattern_str="('|;|insert|delete)+".
    I know it is not correct. It could not be used to only match the whole word insert or delete. Each character in the two words can be matched and it is not what I want. Do you have any idea to only match the whole word?
    Thanks,
    Ricky
    Edited by: Ricky Ru on 28/04/2011 02:29

    Avoid dynamic sql, avoid string concatenation and use bind variables and the risk is negligible.

  • Does Applescript include and support Regular Expressions?

    I'm starting to study regular expressions, and I just discovered AppleScript. So I wondered if AppleScript - or some other Mac utility - offers features that help with regular expressions.
    I'm trying to figure out a variety of search and replace operations. For example, I'd like to copy a table, then replace every row in Table A that includes the word "billion," replacing every row with the word "million" in Table B.
    I just wondered if AppleScript offers any shortcuts for figuring out complex regex operations like this.
    Thanks.

    While AppleScript has the usual kinds of comparisons, I don't know if I would consider them regular expressions. The Terminal gives you access to various utilities that do use regular expressions - see the bash and re_format manual pages.

  • InDesign CS6 and C# (Regular expression)

    GREP does not work
    //CODE
    InDesign.Application InDesignApp = (InDesign.Application)Activator.CreateInstance(Type.GetTypeFromProgID("InDesign.Applicati on"));
    InDesignApp.Activate();
    //Create Document
    InDesign.Document InDesignDoc = InDesignApp.Documents.Add();
    //PageWidth
    InDesignDoc.DocumentPreferences.PageWidth = Convert.ToDouble(numericUpDown_width.Value);
    //PageHeight
    InDesignDoc.DocumentPreferences.PageHeight = Convert.ToDouble(numericUpDown_height.Value);
    InDesignDoc.DocumentPreferences.PageOrientation = idPageOrientation.idPortrait;
    InDesignDoc.DocumentPreferences.PagesPerDocument = 50;
    InDesignDoc.DocumentPreferences.StartPageNumber = 1;
    InDesign.Page page = (InDesign.Page)InDesignDoc.Pages[1];
    InDesign.Layer layer = (InDesign.Layer)InDesignDoc.Layers[1];
    //Place *.docx in Document
    page.Place("C:\\sample.docx", new[] { 0, 0 }, layer, false, true);
    InDesign.Document Doc = (InDesign.Document)InDesignApp.ActiveDocument;
    //Clear the find/change grep preferences
    InDesignApp.FindGrepPreferences = idNothingEnum.idNothing;
    InDesignApp.ChangeGrepPreferences = idNothingEnum.idNothing;
    //Set the find options
    InDesignApp.FindChangeGrepOptions.includeFootnotes = true;
    InDesignApp.FindChangeGrepOptions.includeHiddenLayers = true;
    InDesignApp.FindChangeGrepOptions.includeLockedLayersForFind = true; ;
    InDesignApp.FindChangeGrepOptions.includeLockedStoriesForFind = true;
    InDesignApp.FindChangeGrepOptions.includeMasterPages = true;
    //Regular expression for finding an email address
    InDesignApp.FindGrepPreferences.findWhat = "(?i)[A-Z]*?@[A-Z]*?[.]...";
    Doc.FindGrep();
    //Apply the change to 24-point text only
    InDesignApp.FindGrepPreferences.pointSize = 28;
    InDesignApp.ChangeGrepPreferences.underline = true;
    Doc.ChangeGrep();
    //Clear the find/change grep preferences
    InDesignApp.FindGrepPreferences = idNothingEnum.idNothing;
    InDesignApp.ChangeGrepPreferences = idNothingEnum.idNothing;
    //END CODE
    where am I wrong?

    For the beginning you're in the wrong forum, this is the place for C++ plugin development.
    Whether using C# (a strongly typed language) to access the scripting API (which prefers weakly typed scripting languages) is wrong lies in the eye of the beholder.
    Then you should add some more prose. At least rephrase the problem, why you think that grep does not work. Does it find nothing, or too much? Do you have no visual feedback of the operation? Does it throw an error? Does it just clear the findings?
    From just looking at your script:
    - Why do you need two document variables?
    - You set the find preferences after you invoke FindGrep()
    - the comment says 24 point but the value is 28 point. Are you sure about either, the actually applied value might be 23.98?
    - the only purpose of FindGrep() is to find and yield the findings for further processing by a script. Use the result or remove the statement. Doc.ChangeGrep later on implies a FindGrep.
    - You only set the underline flag, but there are many more attributes involved with underlines (depends on the effective style) such as underline color or underline stroke width and so forth.
    - the findWhat value ends with 3 dots, it might not be what you want.
    - The question mark in "*?" is redundant. Twice.
    - I won't even try to understand more of your grep expression. For such issues there is the interactive mode of InDesign called "UI". It has many fancy windows, dialogs and panels where you can experiment with various settings before you turn them into a script. I'd especially recommend the Find/Change dialog (you can try and tweak the grep string until it breaks) and the underline options dialog of the character attributes panel.
    At least in JavaScript you can later on dump the "properties" property of any native object in order to copy the working values into your script. So you also make sure you don't miss the better half of them. It should not be too hard to translate that JSON into C#.
    e.g. type this in ExendScript Toolkit console
    $.writeln(app.findGrepPreferences.properties.toSource());
    $.writeln(app.selection[0].properties.toSource());
    Finally
    - consider to set the changeTo value to an appropriate expression.
    - consider to use the dynamically evaluated grep styles instead of that script.
    - Probably I missed a few points.
    Dirk

  • Java Regular Expressions and Pattern

    I have a file that i first want to get all the lines that match a given pattern. Then from these lines that match i want to extract two values.
    Example line for the pattern to match
    INFO | jvm 1 | 2006/11/07 15:14:09 | INFO | Tue Nov 07 15:14:09 CET 2006 | XLDB PPS Data Dumper: MESSAGE:- 406 Processing .. '[ /opt/nexus/horizon/raw_data/network/pp_CE01S4H_sta_20050703T015717_SYDP3001_546.bdf ]'
    So all the lines that are like these i want to extract two variables
    2006/11/07 15:14:09
    and
    /opt/nexus/horizon/raw_data/network/pp_CE01S4H_sta_20050703T015717_SYDP3001_546.bdf
    so i can store these variables in a database.
    Can someone help me with writing the pattern to match and the regular express to extract? Also if anyone else has a better way of doing this i am all ears and i have a lot of log files to go through.

    import java.util.regex.*;
    class Main
      public static void main(String[] args)
        String txt="INFO | jvm 1 | 2006/11/07 15:14:09 | INFO | Tue Nov 07 15:14:09 CET 2006 | XLDB PPS Data Dumper: MESSAGE:- 406 Processing .. '[ /opt/nexus/horizon/raw_data/network/pp_CE01S4H_sta_20050703T015717_SYDP3001_546.bdf ]'";
        String re1=".*?";     // Non-greedy match on filler
        String re2="((?:2|1)\\d{3}(?:-|\\/)(?:(?:0[1-9])|(?:1[0-2]))(?:-|\\/)(?:(?:0[1-9])|(?:[1-2][0-9])|(?:3[0-1]))(?:T|\\s)(?:(?:[0-1][0-9])|(?:2[0-3])):(?:[0-5][0-9]):(?:[0-5][0-9]))";     // Time Stamp 1
        String re3=".*?";     // Non-greedy match on filler
        String re4="((?:\\/[\\w\\.]+)+)";     // Unix Path 1
        Pattern p = Pattern.compile(re1+re2+re3+re4,Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
        Matcher m = p.matcher(txt);
        if (m.find())
            String timestamp1=m.group(1);
            String unixpath1=m.group(2);
            System.out.print("("+timestamp1.toString()+")"+"("+unixpath1.toString()+")"+"\n");
    }

  • Regular expressions with boolean connectives (AND, OR, NOT) in Java?

    I'd like to use regular expression patterns that are made up of simple regex patterns connected via AND, OR, or NOT operators, in order to do some keyword-style pattern matching.
    A pattern could look like this:
    (.*Is there.*) && (.*library.*) && !((.*badword.*) || (^$))
    Is there any Java regex library that allows these operators?
    I know that in principle these operators should be available, since Regular languages are closed under union, intersection, and complement.

    AND is implicit,
    xy -- means x AND yThat's not what I need, though, since this is just
    concatenation of a regex.
    Thus, /xy/ would not match the string "a y a x",
    because y precedes x.So it has to contain both x and y, but they could be
    in any order?
    You can't do that easily or generally.
    "x.*y|y.*x" wouldll work here, but obviously
    it will get ugly factorially fast as you add more
    terms.You got that right: AND means the regex operands can appear in any order.
    That's why I'm looking for some regex library that does all this ugly work for me. Again, from a theoretical point of view, it IS possible to express the described semantics of AND with regular expressions, although they will get rather obfuscated.
    Unless somebody has done something similar in java (e.g., for C++, there's Ragel: http://www.cs.queensu.ca/~thurston/ragel/) , I will probably use some finite-state-machine libraries and compile the complex regex's into automata (which can be minimized using well-defined operations on FSMs).
    >
    You'd probably just be better off doing multiple
    calls to matches() or whatever. Yes, that's another possibility, do the boolean operators in Java itself.
    Of course, if you
    really are just looking for literals, then you can
    just use str.contains(a) && !str.contains(b) &&
    (str.contains(c) || str.contains(d)). You don't
    seem to need regex--at least not from your example.OK, bad example, I do have "real" regexp's in there :)

  • Re: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't forget about the regular expression potential

    Namburi,
    When you said you used the Reg Exp tool, did you use it only as
    preconfigured by the iMT migrate application wizard?
    Because the default configuration of the regular expression tool will only
    target the files in your ND project directories. If you wish to target
    classes outside of the normal directory scope, you have to either modify the
    "Source Directory" property OR create another instance of the regular
    expression tool. See the "Tool" menu in the iMT to create additional tool
    instances which can each be configured to target different sets of files
    using different sets of rules.
    Usually, I utilize 3 different sets of rules files on a given migration:
    spider2jato.xml
    these are the generic conversion rules (but includes the optimized rules for
    ViewBean and Model based code, i.e. these rules do not utilize the
    RequestManager since it is not needed for code running inside the ViewBean
    or Model classes)
    I run these rules against all files.
    See the file download section of this forum for periodic updates to these
    rules.
    nonProjectFileRules.xml
    these include rules that add the necessary
    RequestManager.getRequestContext(). etc prefixes to many of the common
    calls.
    I run these rules against user module and any other classes that do not are
    not ModuleServlet, ContainerView, or Model classes.
    appXRules.xml
    these rules include application specific changes that I discover while
    working on the project. A common thing here is changing import statements
    (since the migration tool moves ND project code into different jato
    packaging structure, you sometime need to adjust imports in non-project
    classes that previously imported ND project specific packages)
    So you see, you are not limited to one set of rules at all. Just be careful
    to keep track of your backups (the regexp tool provides several options in
    its Expert Properties related to back up strategies).
    ----- Original Message -----
    From: <vnamboori@y...>
    Sent: Wednesday, August 08, 2001 6:08 AM
    Subject: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't
    forget about the regular expression potential
    Thanks Matt, Mike, Todd
    This is a great input for our migration. Though we used the existing
    Regular Expression Mapping tool, we did not change this to meet our
    own needs as mentioned by Mike.
    We would certainly incorporate this to ease our migration.
    Namburi
    --- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
    All--
    Great response. By the way, the Regular Expression Tool uses thePerl5 RE
    syntax as implemented by Apache OROMatcher. If you're doing lotsof these
    sorts of migration changes manually, you should definitely buy theO'Reilly
    book "Mastering Regular Expressions" and generate some rules toautomate the
    conversion. Although they are definitely confusing at first,regular
    expressions are fairly easy to understand with some documentation,and are
    superbly effective at tackling this kind of migration task.
    Todd
    ----- Original Message -----
    From: "Mike Frisino" <Michael.Frisino@S...>
    Sent: Tuesday, August 07, 2001 5:20 PM
    Subject: Re: [iPlanet-JATO] Use Of models in utility classes -Pease don't
    forget about the regular expression potential
    Also, (and Matt's document may mention this)
    Please bear in mind that this statement is not totally correct:
    Since the migration tool does not do much of conversion for
    these
    utilities we have to do manually.Remember, the iMT is a SUITE of tools. There is the extractiontool, and
    the translation tool, and the regular expression tool, and severalother
    smaller tools (like the jar and compilation tools). It is correctto state
    that the extraction and translation tools only significantlyconvert the
    primary ND project objects (the pages, the data objects, and theproject
    classes). The extraction and translation tools do minimumtranslation of the
    User Module objects (i.e. they repackage the user module classes inthe new
    jato module packages). It is correct that for all other utilityclasses
    which are not formally part of the ND project, the extraction and
    translation tools do not perform any migration.
    However, the regular expression tool can "migrate" any arbitrary
    file
    (utility classes etc) to the degree that the regular expressionrules
    correlate to the code present in the arbitrary file. So first andforemost,
    if you have alot of spider code in your non-project classes youshould
    consider using the regular expression tool and if warranted adding
    additional rules to reduce the amount of manual adjustments thatneed to be
    made. I can stress this enough. We can even help you write theregular
    expression rules if you simply identify the code pattern you wish to
    convert. Just because there is not already a regular expressionrule to
    match your need does not mean it can't be written. We have notnearly
    exhausted the possibilities.
    For example if you say, we need to convert
    CSpider.getDataObject("X");
    To
    RequestManager.getRequestContext().getModelManager().getModel(XModel.class);
    Maybe we or somebody else in the list can help write that regularexpression if it has not already been written. For instance in thelast
    updated spider2jato.xml file there is already aCSpider.getCommonPage("X")
    rule:
    <!--getPage to getViewBean-->
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[getViewBean($1ViewBean.class]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    Following this example a getDataObject to getModel would look
    like this:
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[getModel($1Model.class]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    In fact, one migration developer already wrote that rule andsubmitted it
    for inclusion in the basic set. I will post another upgrade to thebasic
    regular expression rule set, look for a "file uploaded" posting.Also,
    please consider contributing any additional generic rules that youhave
    written for inclusion in the basic set.
    Please not, that in some cases (Utility classes in particular)
    the rule
    application may be more effective as TWO sequention rules ratherthan one
    monolithic rule. Again using the example above, it will convert
    CSpider.getDataObject("Foo");
    To
    getModel(FooModel.class);
    Now that is the most effective conversion for that code if that
    code is in
    a page or data object class file. But if that code is in a Utilityclass you
    really want:
    >
    RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
    So to go from
    getModel(FooModel.class);
    To
    RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
    You would apply a second rule AND you would ONLY run this rule
    against
    your utility classes so that you would not otherwise affect yourViewBean
    and Model classes which are completely fine with the simplegetModel call.
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[getModel\(]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[getModel\(]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[RequestManager.getRequestContext().getModelManager().getModel(]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    A similer rule can be applied to getSession and other CSpider APIcalls.
    For instance here is the rule for converting getSession calls toleverage
    the RequestManager.
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[getSession\(\)\.]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[getSession\(\)\.]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[RequestManager.getSession().]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    ----- Original Message -----
    From: "Matthew Stevens" <matthew.stevens@e...>
    Sent: Tuesday, August 07, 2001 12:56 PM
    Subject: RE: [iPlanet-JATO] Use Of models in utility classes
    Namburi,
    I will post a document to the group site this evening which has
    the
    details
    on various tactics of migrating these type of utilities.
    Essentially,
    you
    either need to convert these utilities to Models themselves or
    keep the
    utilities as is and simply use the
    RequestManager.getRequestContext.getModelManager().getModel()
    to statically access Models.
    For CSpSelect.executeImmediate() I have an example of customhelper
    method
    as a replacement whicch uses JDBC results instead of
    CSpDBResult.
    matt
    -----Original Message-----
    From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
    Sent: Tuesday, August 07, 2001 3:24 PM
    Subject: [iPlanet-JATO] Use Of models in utility classes
    Hi All,
    In the present ND project we have lots of utility classes.
    These
    classes in diffrent directory. Not part of nd pages.
    In these classes we access the dataobjects and do themanipulations.
    So we access dataobjects directly like
    CSpider.getDataObject("do....");
    and then execute it.
    Since the migration tool does not do much of conversion forthese
    utilities we have to do manually.
    My question is Can we access the the models in the postmigration
    sameway or do we need requestContext?
    We have lots of utility classes which are DataObjectintensive. Can
    someone suggest a better way to migrate this kind of code.
    Thanks
    Namburi
    [email protected]
    [email protected]
    [Non-text portions of this message have been removed]
    [email protected]
    [email protected]

    Namburi,
    When you said you used the Reg Exp tool, did you use it only as
    preconfigured by the iMT migrate application wizard?
    Because the default configuration of the regular expression tool will only
    target the files in your ND project directories. If you wish to target
    classes outside of the normal directory scope, you have to either modify the
    "Source Directory" property OR create another instance of the regular
    expression tool. See the "Tool" menu in the iMT to create additional tool
    instances which can each be configured to target different sets of files
    using different sets of rules.
    Usually, I utilize 3 different sets of rules files on a given migration:
    spider2jato.xml
    these are the generic conversion rules (but includes the optimized rules for
    ViewBean and Model based code, i.e. these rules do not utilize the
    RequestManager since it is not needed for code running inside the ViewBean
    or Model classes)
    I run these rules against all files.
    See the file download section of this forum for periodic updates to these
    rules.
    nonProjectFileRules.xml
    these include rules that add the necessary
    RequestManager.getRequestContext(). etc prefixes to many of the common
    calls.
    I run these rules against user module and any other classes that do not are
    not ModuleServlet, ContainerView, or Model classes.
    appXRules.xml
    these rules include application specific changes that I discover while
    working on the project. A common thing here is changing import statements
    (since the migration tool moves ND project code into different jato
    packaging structure, you sometime need to adjust imports in non-project
    classes that previously imported ND project specific packages)
    So you see, you are not limited to one set of rules at all. Just be careful
    to keep track of your backups (the regexp tool provides several options in
    its Expert Properties related to back up strategies).
    ----- Original Message -----
    From: <vnamboori@y...>
    Sent: Wednesday, August 08, 2001 6:08 AM
    Subject: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't
    forget about the regular expression potential
    Thanks Matt, Mike, Todd
    This is a great input for our migration. Though we used the existing
    Regular Expression Mapping tool, we did not change this to meet our
    own needs as mentioned by Mike.
    We would certainly incorporate this to ease our migration.
    Namburi
    --- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
    All--
    Great response. By the way, the Regular Expression Tool uses thePerl5 RE
    syntax as implemented by Apache OROMatcher. If you're doing lotsof these
    sorts of migration changes manually, you should definitely buy theO'Reilly
    book "Mastering Regular Expressions" and generate some rules toautomate the
    conversion. Although they are definitely confusing at first,regular
    expressions are fairly easy to understand with some documentation,and are
    superbly effective at tackling this kind of migration task.
    Todd
    ----- Original Message -----
    From: "Mike Frisino" <Michael.Frisino@S...>
    Sent: Tuesday, August 07, 2001 5:20 PM
    Subject: Re: [iPlanet-JATO] Use Of models in utility classes -Pease don't
    forget about the regular expression potential
    Also, (and Matt's document may mention this)
    Please bear in mind that this statement is not totally correct:
    Since the migration tool does not do much of conversion for
    these
    utilities we have to do manually.Remember, the iMT is a SUITE of tools. There is the extractiontool, and
    the translation tool, and the regular expression tool, and severalother
    smaller tools (like the jar and compilation tools). It is correctto state
    that the extraction and translation tools only significantlyconvert the
    primary ND project objects (the pages, the data objects, and theproject
    classes). The extraction and translation tools do minimumtranslation of the
    User Module objects (i.e. they repackage the user module classes inthe new
    jato module packages). It is correct that for all other utilityclasses
    which are not formally part of the ND project, the extraction and
    translation tools do not perform any migration.
    However, the regular expression tool can "migrate" any arbitrary
    file
    (utility classes etc) to the degree that the regular expressionrules
    correlate to the code present in the arbitrary file. So first andforemost,
    if you have alot of spider code in your non-project classes youshould
    consider using the regular expression tool and if warranted adding
    additional rules to reduce the amount of manual adjustments thatneed to be
    made. I can stress this enough. We can even help you write theregular
    expression rules if you simply identify the code pattern you wish to
    convert. Just because there is not already a regular expressionrule to
    match your need does not mean it can't be written. We have notnearly
    exhausted the possibilities.
    For example if you say, we need to convert
    CSpider.getDataObject("X");
    To
    RequestManager.getRequestContext().getModelManager().getModel(XModel.class);
    Maybe we or somebody else in the list can help write that regularexpression if it has not already been written. For instance in thelast
    updated spider2jato.xml file there is already aCSpider.getCommonPage("X")
    rule:
    <!--getPage to getViewBean-->
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[getViewBean($1ViewBean.class]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    Following this example a getDataObject to getModel would look
    like this:
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[getModel($1Model.class]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    In fact, one migration developer already wrote that rule andsubmitted it
    for inclusion in the basic set. I will post another upgrade to thebasic
    regular expression rule set, look for a "file uploaded" posting.Also,
    please consider contributing any additional generic rules that youhave
    written for inclusion in the basic set.
    Please not, that in some cases (Utility classes in particular)
    the rule
    application may be more effective as TWO sequention rules ratherthan one
    monolithic rule. Again using the example above, it will convert
    CSpider.getDataObject("Foo");
    To
    getModel(FooModel.class);
    Now that is the most effective conversion for that code if that
    code is in
    a page or data object class file. But if that code is in a Utilityclass you
    really want:
    >
    RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
    So to go from
    getModel(FooModel.class);
    To
    RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
    You would apply a second rule AND you would ONLY run this rule
    against
    your utility classes so that you would not otherwise affect yourViewBean
    and Model classes which are completely fine with the simplegetModel call.
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[getModel\(]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[getModel\(]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[RequestManager.getRequestContext().getModelManager().getModel(]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    A similer rule can be applied to getSession and other CSpider APIcalls.
    For instance here is the rule for converting getSession calls toleverage
    the RequestManager.
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[getSession\(\)\.]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[getSession\(\)\.]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[RequestManager.getSession().]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    ----- Original Message -----
    From: "Matthew Stevens" <matthew.stevens@e...>
    Sent: Tuesday, August 07, 2001 12:56 PM
    Subject: RE: [iPlanet-JATO] Use Of models in utility classes
    Namburi,
    I will post a document to the group site this evening which has
    the
    details
    on various tactics of migrating these type of utilities.
    Essentially,
    you
    either need to convert these utilities to Models themselves or
    keep the
    utilities as is and simply use the
    RequestManager.getRequestContext.getModelManager().getModel()
    to statically access Models.
    For CSpSelect.executeImmediate() I have an example of customhelper
    method
    as a replacement whicch uses JDBC results instead of
    CSpDBResult.
    matt
    -----Original Message-----
    From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
    Sent: Tuesday, August 07, 2001 3:24 PM
    Subject: [iPlanet-JATO] Use Of models in utility classes
    Hi All,
    In the present ND project we have lots of utility classes.
    These
    classes in diffrent directory. Not part of nd pages.
    In these classes we access the dataobjects and do themanipulations.
    So we access dataobjects directly like
    CSpider.getDataObject("do....");
    and then execute it.
    Since the migration tool does not do much of conversion forthese
    utilities we have to do manually.
    My question is Can we access the the models in the postmigration
    sameway or do we need requestContext?
    We have lots of utility classes which are DataObjectintensive. Can
    someone suggest a better way to migrate this kind of code.
    Thanks
    Namburi
    [email protected]
    [email protected]
    [Non-text portions of this message have been removed]
    [email protected]
    [email protected]

  • Regular expressions in ActionScript??

    I have been looking at the Adobe publication Programming Action Script (pdf) and it
    specifies ECMA-262 3rd edition specification. But the specification don't seem to
    state exactly what type of regular expression engine and version is used.
    Is it POSIX, or PERL compatible regular expressions (or both)?
    I have read and used the classic O'Reilly text Mastering Regular Expressions
    and coded regular expressions in javascript/php/etc (anywhere regular expressions
    could be use, Apache configuration file, other server config files, etc etc etc)
    There is a difference in the type of engine used, where as performance is
    concerned, as well as the range of syntax valid in a particular implementation.
    Thank You
    JK

    http://www.regular-expressions.info/javascript.html

  • How can I add Regular Expression verify?

    I need to write a Regular Expression for date whose format is 'yyyy-mm-dd'('2004-5-3' or '2004-05-03') and a Regular Expression for phone number whoes format is '12345678' or '1234567' or '13809441234'.
    Thanks for any help.

    The date format is a little tricky as there are many invalid combinations. You'd be better off calling TO_DATE with your user input and format mask. If an error is returned, the date is invalid.
    For the phone number assuming a valid phone number could be 7, 8, or 11 digits (it's a little difficult to tell what the format your suggest is) then you could apply something like the following:
    ^[0-9]{7}([0-9]|[0-9]{4})?$
    Regards.

  • [CC] Search&Replace: Bug only with Regular Expressions

    Can you confirm the following behaviour/bug?
    Steps to reproduce:
    1 Create a new document in DW CC
    2 Enter that text in the source code view:
    <p>&euro;</p>
    3 Open Search&Replace
    Field Search in: Current document
    Field Search: Text
    Field Search (3rd Field): €
    Start Search
    Result: As expected the "€" is found.
    4 [x] Regular Expressions
    Start Search
    Result: "€" isn't found
    Can you reproduce that?
    Do you regard that as a bug like me?
    If not, why please?
    Do you think it is technically impossible for the developers to solve the task?
    Do you think the developers forgot to gray out "text" in the choice box and allow regular expressions only in source code?
    Thanks.

    Nice that you like the nick
    Sure, I know that I can file a feature wish.
    But my main interest in this forum is to know, what other users think about certain features, why they think so, which they miss, which they regard as a bug, ...
    When I remember it right, you told me some time ago, that you don't use RegEx.
    Than I understand, that everything around that feature is not important for you.
    What I like to understand is, why you think the behaviour is logically.
    For me it is the opposite.
    You get a result with "Scope: Text", "[ ]RegEx".
    And you get no result with "Scope: Text", "[x]RegEx".
    Incredible strange.
    I would appreciate, if you could explain more detailed your view.

  • Combine 2 or more regular expressions

    Hello
    I would like to ask, if it is possible to combine more search and replace regular expressions in dreamweaver (direct input or combining .drw files)
    for example, something easy:
    search: Adobe
    replace: $1&reg;
    and in same step also:
    search: euro; ([0-9])([0-9])([0-9])([0-9]),([0-9])([0-9])
    replace: euro; $1.$2$3$4,$5$6
    I would like to speed up my work and instead of 3 searc&replaces use only one.
    Thanks for your help

    st3n wrote:
    I would like to ask, if it is possible to combine more search and replace regular expressions in dreamweaver (direct input or combining .drw files)
    No. Although it's possible to combine the regular expressions to search for the different values, there's only one replacement value. Using your example would not only add &reg; after Adobe, but also in front of euro;. Under the hood, Dreamweaver is simply using the JavaScript replace() method.
    By the way, your second regex could be simplified like this:
    search: (euro; \d)(\d{3},\d{2})
    replace: $1.$2

  • Do J2ME support Regular Expressions?

    If yes, how can i do that
    i want to get a html page by the j2me
    and use Regular Expressions to get all link from it (eg. http://yahoo.com/123.php )

    you can write your own code to do it parsing the text using a blank space to separate words, then analize them. I guess sun wont support regular expressions sooner but you can code it if needed.

  • Mining for regular expressions from text

    Hi all
    I have a situation where I need to develop a set of regular expressions from lists.
    I have lists of files uploaded and downloaded, and when the event happened. I need to analyze these and boil them down to a set of regular expressions.
    The regular expressions will be used in the future to check the logs for activities. For example:
    foo*.zip is downloaded every night. Has it been downloaded tonight.
    I am looking for help in analyzing the lists of files and deriving regular expressions to describe them.
    Any ideas?
    Thanks all

    check the url http://java.sun.com/developer/technicalArticles/releases/1.4regex/index.html

  • Phone number with regular expression

    Hi,
    is it possible to use regular expression for phone numbers?
    I want to create contacts for companies with several direct dial in numbers. My idea is to make one contact for the company itself with the base telephone number and a regular expression like an asterisk and separate contacts for person inside the company containing the direct dial in number.

    but a third-party app could not tell me who (anybody from the company or a special direct dial in number) is calling me at this very moment. So sounds like no way anyhow.

Maybe you are looking for

  • Program for LE_SHP_DELNOTE (smartform)

    Hi, I've to do some changes at my sapscript for shipment (TC VT03N) and I want to make change to smartforms; it's a good moment... I know the following: In SAPScript, you can use SHIPMENT_DOC and program RV56TD00 But... In SmartForms, you can use LE_

  • Can iMovie be used with Panasonic AVCHD camcorder?

    Have a friend who came back from Japan with a camera so new, its not yet available here. It's the Panasonic HDC-DX1-S, and it records HD on 3-inch discs. He wants to be able to import the footage into iMovie, but I've had little luck. I am familiar w

  • Firefox crashes when I try to access the 'tools/Add-on menu'

    I am trying to determine which add-on causes firefox to crash. When I click on 'Tools', then "add-on', it crashes every time. What can I do to find out which add-on is faulty?

  • HTML Expressions and HTML

    I an using the column formatting HTML Expression: Ex:<i>#TITLE#</i><br>#PRESENTER#, #INST_NAME# This works just fine until I need additional HTML for one of the items. The HTML is in the database for the field TITLE and want to have that HTML display

  • How to make a Window object Transparent

    hi all, how can i make an object of Window Class transparent. please help me out friends.