Regular expressions in Configuration plan

Hi,
Can we use regular expression in configuration/deployment plan while searching for specific text in composite.xml?
Thanks
Sree

May be forms related question better answered in forms forum.
Forms

Similar Messages

  • Bought an Airport Express in Slovenia, planning to use it in Moscow. When configuring, Moscow is not an option for location. I ticked Ljubljana for set up; got green light, but network not working. Is choice of city the problem?

    While on vacation, I bought an Airport Express in Slovenia, planning to use it in my Moscow apartment. I plugged everything in, seem to have followed the directions properly for configuration - except for one thing.  Moscow does not come up as an option for location. So I tried ticking Ljubljana (Slovenia) as location (since that's where I bought it). The cycle seemed to have worked, I got a green light on the Airport Express, but the network didn't work.  I tried going in to change the location, and chose something called Universal, but the network still didn't work.
    Is the fact that Moscow doesn't come up among the options going to be a problem?  Or is it possible I am doing something else wrong?
    Anyone have any insights? 

    AirPort Utility for the iPhone, iPad, etc does not support the older version of the AirPort Express that you have.
    Try installing AirPort Utility on the Lenovo laptop to see if you can configure the AirPort Express that way.
    If the laptop runs XP SP3 or Vista SP2.....use AirPort Utility 5.5.3 for Windows - Support - Apple
    Windows 7....use AirPort Utility 5.6.1 for Windows 7 - Support - Apple
    Remember that the SB5101 modem must be fully reset before it will associate correctly with the AirPort Express. That means pressing the reset button on the back of the modem (if present) and powering off the modem for at least 30 minutes, then connecting it to the AirPort.

  • Regular Expression and jUnit in ADF Mobile

    Hi Guys,
    I tried to implement Regular Expression in ADF Mobile, but in my jUnit that I was configured to unit test purpose in my application.
    Shown error below inside jUnit plane.
    java.lang.NoClassDefFoundError: oracle/adfmf/util/regex/Pattern
    How to solve this issue for jUnit ?

    I'll start by answering your Q2 - while in theory you can use the same application for both accessing from a browser on a pc and on a phone - in reality the user experience on the phone is not going to be good because of the limitation of the screen size. Users will need to constantly zoom-in scroll around etc. This is why many people who target application for smart phones prefer to build a separate UI for the mobile device.
    Now question 4 which relates to 1 - We haven't tested the ADF Faces components on the browser of blackberry and so there is a chance that some of their functionality won't work there. We did test and certify the ADF Faces components with the safari mobile browser (iOS) - so this is why you see them work there better.
    This is why we recommend that if you are targeting a blackberry (and other mobile devices) you'll use the Trinidad set of components and in general ADF Mobile Browser project type.
    (see example here: https://blogs.oracle.com/shay/entry/building_iphone_interfaces_for_oracle ). This also means that you'll have the check box checked for mobile device when you create a JSF page.
    For question 3 - when the next ADF Mobile solution will be released you'll be able to create applications that install on the device itself.

  • URL paths and regular expressions in ASDM

    Some background info - I've recently switched to an ASA 5510 on 8.4(3) coming from a Checkpoint NGX platform (let's say fairly quickly and without much warning ). I have a couple questions and they're kind of similar so I'll post them up. I've read docs about regex and creating them both via command line and ASDM, but the examples always seem to include info I don't need or honestly something I don't understand yet (mainly related to defining class\inspect maps). If someone could provide a simple example of how to do these in ASDM that would help a lot in understanding how regular expressions are properly configured. So here we go.
    I know this is basic but I need to make sure I understand this properly - I have a single web server (so this won't be a global policy) where I need to allow access to a specific URL path\file and that's it. So we'll call it \test\testfile.doc. Any other access to any other path should be dropped. What's the best way to do this in ASDM (6.4)? I think if I saw a basic example for this I could figure out next few questions but I'll post them as well just in case.
    I have another single public web server (again this won't be a global policy) where I'd like to specify blocking file types, like .php, .exe., etc... again a basic example would be great.
    Lastly, and this is kind of related, but we have a single office/domain and sometimes we get spam from forged addresses appearing to be from our domain. On Checkpoint I used to use its built-in SMTP security server and could define if it received mail from *@mydomain.com to drop it because we would never receive mail externally from our own domain name. I saw something similar with ESMTP in ASDM and it looks kind of like how you set up the URL access mentioned above. Can I configure this in ASDM as well, and if so how?
    TIA for your help,
    Jordan

    /bump

  • 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]

  • [SOLVED]ZSH and regular expressions

    Hi
    I am getting into regular expressions and i have noticed that with my .zshrc file i have some problem. In bash this expression works:
    \^\[^#]
    but not also in zsh. I have also noted that regular expression works fine with other zshrc configurations found in archwiki (like grml) but i want to have my configuration. And i really can't find what command make a difference
    My .zshrc file is pulled from this site https://github.com/slashbeast/things/bl … s/DOTzshrc.
    # .zshrc
    # Author: Piotr Karbowski <[email protected]>
    # License: beerware.
    # Basic zsh config.
    umask 077
    ZDOTDIR=${ZDOTDIR:-${HOME}}
    ZSHDDIR="${HOME}/.config/zsh.d"
    HISTFILE="${ZDOTDIR}/.zsh_history"
    HISTSIZE='10000'
    SAVEHIST="${HISTSIZE}"
    export EDITOR="/usr/bin/vim"
    export TMP="$HOME/tmp"
    export TEMP="$TMP"
    export TMPDIR="$TMP"
    export TMPPREFIX="${TMPDIR}/zsh"
    if [ ! -d "${TMP}" ]; then mkdir "${TMP}"; fi
    if ! [[ "${PATH}" =~ "^${HOME}/bin" ]]; then
    export PATH="${HOME}/bin:${PATH}"
    fi
    # Not all servers have terminfo for rxvt-256color. :<
    if [ "${TERM}" = 'rxvt-256color' ] && ! [ -f '/usr/share/terminfo/r/rxvt-256color' ] && ! [ -f '/lib/terminfo/r/rxvt-256color' ] && ! [ -f "${HOME}/.terminfo/r/rxvt-256color" ]; then
    export TERM='rxvt-unicode'
    fi
    # Colors.
    red='\e[0;31m'
    RED='\e[1;31m'
    green='\e[0;32m'
    GREEN='\e[1;32m'
    yellow='\e[0;33m'
    YELLOW='\e[1;33m'
    blue='\e[0;34m'
    BLUE='\e[1;34m'
    purple='\e[0;35m'
    PURPLE='\e[1;35m'
    cyan='\e[0;36m'
    CYAN='\e[1;36m'
    NC='\e[0m'
    # Functions
    if [ -f '/etc/profile.d/prll.sh' ]; then
    . "/etc/profile.d/prll.sh"
    fi
    run_under_tmux() {
    # Run $1 under session or attach if such session already exist.
    # $2 is optional path, if no specified, will use $1 from $PATH.
    # If you need to pass extra variables, use $2 for it as in example below..
    # Example usage:
    # torrent() { run_under_tmux 'rtorrent' '/usr/local/rtorrent-git/bin/rtorrent'; }
    # mutt() { run_under_tmux 'mutt'; }
    # irc() { run_under_tmux 'irssi' "TERM='screen' command irssi"; }
    # There is a bug in linux's libevent...
    # export EVENT_NOEPOLL=1
    command -v tmux >/dev/null 2>&1 || return 1
    if [ -z "$1" ]; then return 1; fi
    local name="$1"
    if [ -n "$2" ]; then
    local file_path="$2"
    else
    local file_path="command ${name}"
    fi
    if tmux has-session -t "${name}" 2>/dev/null; then
    tmux attach -d -t "${name}"
    else
    tmux new-session -s "${name}" "${file_path}" \; set-option status \; set set-titles-string "${name} (tmux@${HOST})"
    fi
    t() { run_under_tmux rtorrent; }
    irc() { run_under_tmux irssi "TERM='screen' command irssi"; }
    over_ssh() {
    if [ -n "${SSH_CLIENT}" ]; then
    return 0
    else
    return 1
    fi
    reload () {
    exec "${SHELL}" "$@"
    confirm() {
    local answer
    echo -ne "zsh: sure you want to run '${YELLOW}$@${NC}' [yN]? "
    read -q answer
    echo
    if [[ "${answer}" =~ ^[Yy]$ ]]; then
    command "${=1}" "${=@:2}"
    else
    return 1
    fi
    confirm_wrapper() {
    if [ "$1" = '--root' ]; then
    local as_root='true'
    shift
    fi
    local runcommand="$1"; shift
    if [ "${as_root}" = 'true' ] && [ "${USER}" != 'root' ]; then
    runcommand="sudo ${runcommand}"
    fi
    confirm "${runcommand}" "$@"
    poweroff() { confirm_wrapper --root $0 "$@"; }
    reboot() { confirm_wrapper --root $0 "$@"; }
    hibernate() { confirm_wrapper --root $0 "$@"; }
    detox() {
    if [ "$#" -ge 1 ]; then
    confirm detox "$@"
    else
    command detox "$@"
    fi
    has() {
    local string="${1}"
    shift
    local element=''
    for element in "$@"; do
    if [ "${string}" = "${element}" ]; then
    return 0
    fi
    done
    return 1
    begin_with() {
    local string="${1}"
    shift
    local element=''
    for element in "$@"; do
    if [[ "${string}" =~ "^${element}" ]]; then
    return 0
    fi
    done
    return 1
    termtitle() {
    case "$TERM" in
    rxvt*|xterm|nxterm|gnome|screen|screen-*)
    local prompt_host="${(%):-%m}"
    local prompt_user="${(%):-%n}"
    local prompt_char="${(%):-%~}"
    case "$1" in
    precmd)
    printf '\e]0;%s@%s: %s\a' "${prompt_user}" "${prompt_host}" "${prompt_char}"
    preexec)
    printf '\e]0;%s [%s@%s: %s]\a' "$2" "${prompt_user}" "${prompt_host}" "${prompt_char}"
    esac
    esac
    git_check_if_worktree() {
    # This function intend to be only executed in chpwd().
    # Check if the current path is in git repo.
    # We would want stop this function, on some big git repos it can take some time to cd into.
    if [ -n "${skip_zsh_git}" ]; then
    git_pwd_is_worktree='false'
    return 1
    fi
    # The : separated list of paths where we will run check for git repo.
    # If not set, then we will do it only for /root and /home.
    if [ "${UID}" = '0' ]; then
    # running 'git' in repo changes owner of git's index files to root, skip prompt git magic if CWD=/home/*
    git_check_if_workdir_path="${git_check_if_workdir_path:-/root:/etc}"
    else
    git_check_if_workdir_path="${git_check_if_workdir_path:-/home}"
    git_check_if_workdir_path_exclude="${git_check_if_workdir_path_exclude:-${HOME}/_sshfs}"
    fi
    if begin_with "${PWD}" ${=git_check_if_workdir_path//:/ }; then
    if ! begin_with "${PWD}" ${=git_check_if_workdir_path_exclude//:/ }; then
    local git_pwd_is_worktree_match='true'
    else
    local git_pwd_is_worktree_match='false'
    fi
    fi
    if ! [ "${git_pwd_is_worktree_match}" = 'true' ]; then
    git_pwd_is_worktree='false'
    return 1
    fi
    # todo: Prevent checking for /.git or /home/.git, if PWD=/home or PWD=/ maybe...
    # damn annoying RBAC messages about Access denied there.
    if [ -d '.git' ] || [ "$(git rev-parse --is-inside-work-tree 2> /dev/null)" = 'true' ]; then
    git_pwd_is_worktree='true'
    git_worktree_is_bare="$(git config core.bare)"
    else
    unset git_branch git_worktree_is_bare
    git_pwd_is_worktree='false'
    fi
    git_branch() {
    git_branch="$(git symbolic-ref HEAD 2>/dev/null)"
    git_branch="${git_branch##*/}"
    git_branch="${git_branch:-no branch}"
    git_dirty() {
    if [ "${git_worktree_is_bare}" = 'false' ] && [ -n "$(git status --untracked-files='no' --porcelain)" ]; then
    git_dirty='%F{green}*'
    else
    unset git_dirty
    fi
    precmd() {
    # Set terminal title.
    termtitle precmd
    if [ "${git_pwd_is_worktree}" = 'true' ]; then
    git_branch
    git_dirty
    git_prompt=" %F{blue}[%F{253}${git_branch}${git_dirty}%F{blue}]"
    else
    unset git_prompt
    fi
    preexec() {
    # Set terminal title along with current executed command pass as second argument
    termtitle preexec "${(V)1}"
    chpwd() {
    git_check_if_worktree
    man() {
    if command -v vimmanpager >/dev/null 2>&1; then
    PAGER="vimmanpager" command man "$@"
    else
    command man "$@"
    fi
    # Are we running under grsecurity's RBAC?
    rbac_auth() {
    local auth_to_role='admin'
    if [ "${USER}" = 'root' ]; then
    if ! grep -qE '^RBAC:' "/proc/self/status" && command -v gradm > /dev/null 2>&1; then
    echo -e "\n${BLUE}*${NC} ${GREEN}RBAC${NC} Authorize to '${auth_to_role}' RBAC role."
    gradm -a "${auth_to_role}"
    fi
    fi
    #rbac_auth
    # Check if we started zsh in git worktree, useful with tmux when your new zsh may spawn in source dir.
    git_check_if_worktree
    if [ "${git_pwd_is_worktree}" = 'true' ]; then
    git_branch
    git_dirty
    git_prompt=" %F{blue}[%F{253}${git_branch}${git_dirty}%F{blue}]"
    else
    unset git_prompt
    fi
    # Le features!
    # extended globbing, awesome!
    setopt extendedGlob
    # zmv - a command for renaming files by means of shell patterns.
    autoload -U zmv
    # zargs, as an alternative to find -exec and xargs.
    autoload -U zargs
    # Turn on command substitution in the prompt (and parameter expansion and arithmetic expansion).
    setopt promptsubst
    # Control-x-e to open current line in $EDITOR, awesome when writting functions or editing multiline commands.
    autoload -U edit-command-line
    zle -N edit-command-line
    bindkey '^x^e' edit-command-line
    # Include user-specified configs.
    if [ ! -d "${ZSHDDIR}" ]; then
    mkdir -p "${ZSHDDIR}" && echo "# Put your user-specified config here." > "${ZSHDDIR}/example.zsh"
    fi
    for zshd in $(ls -A ${HOME}/.config/zsh.d/^*.(z)sh$); do
    . "${zshd}"
    done
    # Completion.
    autoload -Uz compinit
    compinit
    zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
    zstyle ':completion:*' completer _expand _complete _ignored _approximate
    zstyle ':completion:*' menu select=2
    zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s'
    zstyle ':completion::complete:*' use-cache 1
    zstyle ':completion:*:descriptions' format '%U%F{cyan}%d%f%u'
    # If running as root and nice >0, renice to 0.
    if [ "$USER" = 'root' ] && [ "$(cut -d ' ' -f 19 /proc/$$/stat)" -gt 0 ]; then
    renice -n 0 -p "$$" && echo "# Adjusted nice level for current shell to 0."
    fi
    # Fancy prompt.
    if over_ssh && [ -z "${TMUX}" ]; then
    prompt_is_ssh='%F{blue}[%F{red}SSH%F{blue}] '
    elif over_ssh; then
    prompt_is_ssh='%F{blue}[%F{253}SSH%F{blue}] '
    else
    unset prompt_is_ssh
    fi
    case $USER in
    root)
    PROMPT='%B%F{cyan}%m%k %(?..%F{blue}[%F{253}%?%F{blue}] )${prompt_is_ssh}%B%F{blue}%1~${git_prompt}%F{blue} %# %b%f%k'
    PROMPT='%B%F{blue}%n@%m%k %(?..%F{blue}[%F{253}%?%F{blue}] )${prompt_is_ssh}%B%F{cyan}%1~${git_prompt}%F{cyan} %# %b%f%k'
    esac
    # Ignore lines prefixed with '#'.
    setopt interactivecomments
    # Ignore duplicate in history.
    setopt hist_ignore_dups
    # Prevent record in history entry if preceding them with at least one space
    setopt hist_ignore_space
    # Nobody need flow control anymore. Troublesome feature.
    #stty -ixon
    setopt noflowcontrol
    # Fix for tmux on linux.
    case "$(uname -o)" in
    'GNU/Linux')
    export EVENT_NOEPOLL=1
    esac
    # Aliases
    alias cp='cp -iv'
    alias rcp='rsync -v --progress'
    alias rmv='rsync -v --progress --remove-source-files'
    alias mv='mv -iv'
    alias rm='rm -iv'
    alias rmdir='rmdir -v'
    alias ln='ln -v'
    alias chmod="chmod -c"
    alias chown="chown -c"
    if command -v colordiff > /dev/null 2>&1; then
    alias diff="colordiff -Nuar"
    else
    alias diff="diff -Nuar"
    fi
    alias grep='grep --colour=auto'
    alias egrep='egrep --colour=auto'
    alias ls='ls --color=auto --human-readable --group-directories-first --classify'
    # Keys.
    case $TERM in
    rxvt*|xterm*)
    bindkey "^[[7~" beginning-of-line #Home key
    bindkey "^[[8~" end-of-line #End key
    bindkey "^[[3~" delete-char #Del key
    bindkey "^[[A" history-beginning-search-backward #Up Arrow
    bindkey "^[[B" history-beginning-search-forward #Down Arrow
    bindkey "^[Oc" forward-word # control + right arrow
    bindkey "^[Od" backward-word # control + left arrow
    bindkey "^H" backward-kill-word # control + backspace
    bindkey "^[[3^" kill-word # control + delete
    linux)
    bindkey "^[[1~" beginning-of-line #Home key
    bindkey "^[[4~" end-of-line #End key
    bindkey "^[[3~" delete-char #Del key
    bindkey "^[[A" history-beginning-search-backward
    bindkey "^[[B" history-beginning-search-forward
    screen|screen-*)
    bindkey "^[[1~" beginning-of-line #Home key
    bindkey "^[[4~" end-of-line #End key
    bindkey "^[[3~" delete-char #Del key
    bindkey "^[[A" history-beginning-search-backward #Up Arrow
    bindkey "^[[B" history-beginning-search-forward #Down Arrow
    bindkey "^[Oc" forward-word # control + right arrow
    bindkey "^[Od" backward-word # control + left arrow
    bindkey "^H" backward-kill-word # control + backspace
    bindkey "^[[3^" kill-word # control + delete
    esac
    bindkey "^R" history-incremental-pattern-search-backward
    bindkey "^S" history-incremental-pattern-search-forward
    if [ -f ~/.alert ]; then cat ~/.alert; fi
    Thanks for all the help.
    Last edited by Shark (2013-05-11 22:32:24)

    Raynman wrote:
    "This expression doesn't work", "It doesn't work" ...
    Could you try being a bit more specific?
    Firstly, i am sorry i didn't post the output. I should have know better.
    Secondly, chill out.
    I have used above regex with grep command. Output from terminal is:
    zsh: bad pattern: ^[^#]
    In bash it works perfectly.
    If i issue "setopt re_match_pcre" i have the same ouput as above.
    EDIT: If i issue "unsetopt no_match" it actually works but i have to change the regex from "\^\[^#]" to "\^[^#]" otherwise i get the same output as above. In bash both options work.
    Last edited by Shark (2013-05-11 22:07:21)

  • Regular Expressions in Oracle

    Hello All,
    I come from Perl scripting language background. Perl's regular expressions are rock solid, robust and very fast.
    Now I am planning to master Regular Expressions in Oracle.
    Could someone please point the correct place to start with it like official Oracle documentation on Regular Expressions, any good book on Regex or may be any online link etc.
    Cheers,
    Parag
    Edited by: Parag Kalra on Dec 19, 2009 11:03 AM

    Hi, Parag,
    Look under [R in the index of the SQL language manual|http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/index.htm#R]. All the regular expression functions and operators start with "REGEXP", and there are a couple of entries under "regular expressions".
    That applies to the Oracle 11 and 10.2 documentation. Regular expressions were hidden in the Oracle 10.1 SQL Language manual; you had to look up some similar function (like REGR_SYY, itself hidden under S for "SQL Functions", and then step through the pages one at a time.
    Sorry, I don't know a good tutorial or introduction.
    If you find something hopeful, please post a reference here. I think a lot of people would be interrested.

  • 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

  • Trying to use regular expressions to convert names to Title Case

    I'm trying to change names to their proper case for most common names in North America (esp. the U.S.).
    Some examples are in the comments of the included code below.
    My problem is that *retName = retName.replaceAll("( [^ ])([^ ]+)", "$1".toUpperCase() + "$2");* does not work as I expect. It seems that the toUpperCase method call does not actually do anything to the identified group.
    Everything else works as I expect.
    I'm hoping that I do not have to iterate through each character of the string, upshifting the characters that follow spaces.
    Any help from you RegEx experts will be appreciated.
    {code}
    * Converts names in some random case into proper Name Case. This method does not have the
    * extra processing that would be necessary to convert street addresses.
    * This method does not add or remove punctuation.
    * Examples:
    * DAN MARINO --> Dan Marino
    * old macdonald --> Old Macdonald &lt;-- Can't capitalize the 'D" because of Ernst Mach
    * ROY BLOUNT, JR. --> Roy Blount, Jr.
    * CAROL mosely-BrAuN --> Carol Mosely-Braun
    * Tom Jones --> Tom Jones
    * ST.LOUIS --> St. Louis
    * ST.LOUIS, MO --> St. Louis, Mo &lt;-- Avoid City Names plus State Codes
    * This is a work in progress that will need to be updated as new exceptions are found.
    public static String toNameCase(String name) {
    * Basic plan:
    * 1. Strategically create double spaces in front of characters to be capitalized
    * 2. Capitalize characters with preceding spaces
    * 3. Remove double spaces.
    // Make the string all lower case
    String retName = name.trim().toLowerCase();
    // Collapse strings of spaces to single spaces
    retName = retName.replaceAll("[ ]+", " ");
    // "mc" names
    retName = retName.replaceAll("( mc)", " $1");
    // Ensure there is one space after periods and commas
    retName = retName.replaceAll("(\\.|,)([^ ])", "$1 $2");
    // Add 2 spaces after periods, commas, hyphens and apostrophes
    retName = retName.replaceAll("(\\.|,|-|')", "$1 ");
    // Add a double space to the front of the string
    retName = " " + retName;
    // Upshift each character that is preceded by a space
    // For some reason this doesn't work
    retName = retName.replaceAll("( [^ ])([^ ]+)", "$1".toUpperCase() + "$2");
    // Remove double spaces
    retName = retName.replaceAll(" ", "");
    return retName;
    Edited by: FuzzyBunnyFeet on Jan 17, 2011 10:56 AM
    Edited by: FuzzyBunnyFeet on Jan 17, 2011 10:57 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Hopefully someone will still be able to provide a RegEx solution, but until that time here is a working method.
    Also, if people have suggestions of other rules for letter capitalization in names, I am interested in those too.
    * Converts names in some random case into proper Name Case.  This method does not have the
    * extra processing that would be necessary to convert street addresses.
    * This method does not add or remove punctuation.
    * Examples:
    * CAROL mosely-BrAuN --&gt; Carol Mosely-Braun
    * carol o'connor --&gt; Carol O'Connor
    * DAN MARINO --&gt; Dan Marino
    * eD mCmAHON --&gt; Ed McMahon
    * joe amcode --&gt; Joe Amcode         &lt;-- Embedded "mc"
    * mr.t --&gt; Mr. T                    &lt;-- Inserted space
    * OLD MACDONALD --&gt; Old Macdonald   &lt;-- Can't capitalize the 'D" because of Ernst Mach
    * old mac donald --&gt; Old Mac Donald
    * ROY BLOUNT,JR. --&gt; Roy Blount, Jr.
    * ST.LOUIS --&gt; St. Louis
    * ST.LOUIS,MO --&gt; St. Louis, Mo     &lt;-- Avoid City Names plus State Codes
    * Tom Jones --&gt; Tom Jones
    * This is a work in progress that will need to be updated as new exceptions are found.
    public static String toNameCase(String name) {
         * Basic plan:
         * 1.  Strategically create double spaces in front of characters to be capitalized
         * 2.  Capitalize characters with preceding spaces
         * 3.  Remove double spaces.
        // Make the string all lower case
        String workStr = name.trim().toLowerCase();
        // Collapse strings of spaces to single spaces
        workStr = workStr.replaceAll("[ ]+", " ");
        // "mc" names
        workStr = workStr.replaceAll("( mc)", "  $1  ");
        // Ensure there is one space after periods and commas
        workStr = workStr.replaceAll("(\\.|,)([^ ])", "$1 $2");
        // Add 2 spaces after periods, commas, hyphens and apostrophes
        workStr = workStr.replaceAll("(\\.|,|-|')", "$1  ");
        // Add a double space to the front of the string
        workStr = "  " + workStr;
        // Upshift each character that is preceded by a space and remove double spaces
        // Can't upshift using regular expressions and String methods
        // workStr = workStr.replaceAll("( [^ ])([^ ]+)", "$1"toUpperCase() + "$2");
        StringBuilder titleCase = new StringBuilder();
        for (int i = 0; i < workStr.length(); i++) {
            if (workStr.charAt(i) == ' ') {
                if (workStr.charAt(i+1) == ' ') {
                    i += 2;
                while (i < workStr.length() && workStr.charAt(i) == ' ') {
                    titleCase.append(workStr.charAt(i++));
                if (i < workStr.length()) {
                    titleCase.append(workStr.substring(i, i+1).toUpperCase());
            } else {
                titleCase.append(workStr.charAt(i));
        return titleCase.toString();
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Converting String Characters into Regular Expression Automatically?

    Hi guys.... is there any program or sample coding which is available to convert string characters into regular expression automatically when the program is run?
    Example:
    String Character Input: fnffffffffffnnnnnnnnnffffffnnfnnnnnnnnnfnnfnfnfffnfnfnfnfnfnnnnd
    When the program runs, it automatically convert into this :
    Regular Expression Output: f*d

    hey guys.... i am sorry for not providing all the information that you guys need as i was rushing off to urgent meeting... for my string characters i only have a to n.. all these characters are collected from sensors and stored inside database... from many demos i have done... i found out that every demo has different strings of characters collected and these string of characters will not match with the regular expressions that i had created due to several unwanted inputs and stuff... i have a lot of different types of plan activities and therefore a lot of regular expressions.... if i put [a-z|0-9]*... it will capture all characters but in the same time it will be showing 1 plan only.... therefore, i am finding ways to get the strings i collected and let it form into regular expression by themselves in the program so that it will appear as different plans as output with comparing with the regular expression that i had created.... is there any way to do so?
    please post again if there is any questions u are still not familiar with... thank you...

  • BUG?? Syntax Highlighting Regular Expressions

    I'm working on a rather long regular expression in
    dreamweaver code view. It has about 200+ characters in it.
    I wrote it in another application and copied it over for use
    in js, and it wouldn't highlight correctly (sort of like when you
    leave off quote on a string). Naturally I thought I screwed up my
    regexp or forgot to escape a character or something so I went
    through it re-writing it and checking everything but it was
    correct. I saved the page and ran it in the browser and sure enough
    it worked.
    So I started typing the regexp from scratch this time in
    dreamweaver to see when it stopped highlighting correctly. It
    stopped at exactly 100 characters including opening and closing
    forward slashes. I tried writing another exp this time filled with
    just one letter. Again 100 characters exactly - not one more.
    Example:
    var reg1 =
    /ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss ssssssssss/
    var reg2 =
    /ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss sssssssssss/
    reg1 will highlight correctly, while reg2 won't.
    Is this a bug or am I missing something? The highlight rule
    (in Configuration\CodeColoring\CodeColoring.xml) is
    (\s*/\e*\\/
    -or-
    =\s*/ \e*\\ /
    There seems to be no limitation to length there.
    While this is not a huge deal, I might as was well be coding
    in notepad (or my other script editors which highlight this
    correctly) because the highlighting is worthless from this point
    on.
    I could make these strings instead of literals but I have a
    lot of these long expressions and would rather not go through them
    and escape all of my back slashes (there are tons) as well as
    quotes - and make them more un-maintainable as they already are.
    Anyone have this problem? Or a solution to it?

    random_acts wrote:
    > I'm working on a rather long regular expression in
    dreamweaver code view. It
    > has about 200+ characters in it.
    I have never written a regex as long as that, but was
    fascinated by your
    question, so attempted to replicate your problem.
    I gave up at 614 characters, but the syntax coloring didn't.
    I suggest
    that you submit a bug report with the details of your actual
    code:
    http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
    David Powers
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "Foundation PHP 5 for Flash" (friends of ED)
    http://foundationphp.com/

  • Juniper MX Regular expressions and user permissions ACS 5.4

    Hi everyone!
    Im having some trouble with regular expressions and permissions on our Juniper MX routers through ACS 5.4, and i would like some insight/help/poitners!!
    We have a team of engineers that should only have read only permissions (important: show configuration) and also be able to just change the description on interfaces.
    Thus far with the following regular expressions set for the shell profile they are going through i have managed the above, however the problem is when an engineer inputs "Show configuration", only the interfaces descriptions configuration is shown! The rest of the configuration will not be printed.
    deny-commands1=.*.
    allow-commands1=configure
    deny-configuration1=.*.
    allow-commands2=interfaces .*. description .*$
    allow-configuration1=interfaces .*. description .*$
    allow-commands2=show configuration.*
    allow-commands3=show configuration
    (some of these regex i know that are not needed, i was just playing around to check everything before posting)
    Any pointers as to why or how to resolve this?
    example output with the above:
    show configuration
    ## Last commit: 2014-01-09 09:34:44 EET by someone
    interfaces {
        xe-0/0/0 {
        xe-0/0/1 {
            description xxxx;
        xe-0/1/0 {
            description xxxx;
        xe-0/1/1 {
            description xxxx;
        xe-0/2/0 {
            disable;
        xe-0/2/1 {
            description xxxx;
        xe-0/3/0 {
            description xxxx;
        xe-0/3/1 {
            description xxxx;
        ae0 {
            description "xxxx";
        ae1 {
            description xxxx;
        demux0 {
        lo0 {
    {master}
    Thanks in advance!
    Spyros

    You are absolutely right!!  I was doing research online after posting the above.  The correct RADIUS attribute to use is actually CVPN3000/ASA/PIX7.x-Group-Based-Address-Pools.  Then create the pool in ASA, and call that pool's name in ACS under that RADIUS attribute.  Someone explained this perfectly in this community before.  Much appreciate your answer!
    Here's from another post last year:
    ACS  5 does not have the feature of IP pools. Logically its always good to  setup pools locally on vpn server and if you want user to pick ip from  specific local pool you can configure acs to push that attribute.
    On ACS Go to > Policy Elements  -> Network Access ->   Authorization Profiles -> Create ->
    Name of the Policy ->Dictionary Type: Radius-Cisco VPN 3000/ASA/PIX7.x
    Attribute Type : CVPN3000/ASA/PIX7.x-Group-Based-Address-Pools
    Attribute Type: String
    Attribute Value : Static MYPOOL (Name of the Pool which is defined on the ASA)
    Access Policies ->Default Network Access -> Authorization ->  Create -> Under result section call the Authorization p

  • Getting "Inner Html" using Regular Expressions. Learning RE in SDK1.4.

    Hello group.
    I am learning Regular Expressions in JAVA SDK 1.4 first. Not PERL or other language.
    Using the utility at the following link I am trying to get all the text between the <TR> and </TR> tags.
    http://jakarta.apache.org/oro/demo.html
    This seems simple but the line returns, breaks etc.. make it more difficult. I have worked on this for hours.
    There will be multiple table rows in my stream.
    My goal is to first get the text between the <TR> Tags...
    Then I was going to use groups to get data0, data1, data2, data3.
    Does this sound like a good plan? Should I use multiple RE or one RE that does 4 group returns.
    I was thinking the applet was causing my problem.
    <TR>.*?</TR> does not work.
    (<tr>\s*([^(</tr>)])+</tr>) does not work.
    I can get data0 to work as well as data1,2,3.
    Would it make more sense to split this multiple row table by </tr>?
    One row of malformed html (actually multiple rows):
    <TR>
    <TD bgColor=#ffffff><A class=fav
    href="http://nicesite.com/data0"
    >nicesite</A><IMG
    src="smile.gif"></TD>
    <TD bgColor=#12ff22><SPAN class=fav>data1</SPAN></TD>
    <TD bgColor=#12ff22><SPAN class=fav>data2</SPAN></TD>
    <TD bgColor=#12ff22><SPAN class=fav>data3</SPAN></TD>
    <TD align=middle bgColor=#ffffff><A
    href="#"><IMG
    src="smile.gif" border=0></A></TD>
    <TD align=middle bgColor=#ffffff>data
              4</TD>
    <TD align=middle bgColor=#ffffff>data5</TD></TR>
    s_____ I have seen some of your post and tryed to apply them. What do you think?
    Regards,
    NupeVic

    http://jakarta.apache.org/oro/demo.htmlI prefer
    http://jregex.sourceforge.net/demoapp.html
    >
    This seems simple but the line returns, breaks etc..
    make it more difficult. Yes, they do indeed
    There will be multiple table rows in my stream.
    My goal is to first get the text between the <TR>
    Tags...
    Then I was going to use groups to get data0, data1,
    data2, data3.
    Does this sound like a good plan? Should I use
    multiple RE or one RE that does 4 group returns.One of the main features of regexes that you must realize
    is that they are mainly suited for non-recursive, linear data structures
    (btw, that's why regexes in general are hardly suited for html).
    So, if the number of TD items is fixed, you could
    1. search using a single pattern for the whole row, something like
    "<PatternForTR>"+
    "<PatternForTD>(<PatternForData>)<PatternFor/TD>"+
    "<PatternForTD>(<PatternForData>)<PatternFor/TD>"+
    "<PatternFor/TR>"
    so the group1 would contain data1 and so on
    Otherwise, you should
    2. find each row using
    "<PatternForTR>(.*?)<PatternFor/TR>",
    then search the contents of group1 using the
    "<PatternForTD>(<PatternForData>)<PatternFor/TD>".
    >
    <TR>.*?</TR> does not work.The pattern itself is ok, but in order for it to work one should enable the DOTALL flag (the 's' flag in jregex demo), as the '.' doesn't accept line breaks by default.
    (<tr>\s*([^(</tr>)])+</tr>) does not work.It seems that [^(</tr>)]+ actually is a nonsense in this context.
    It describes a string that consists of any chars but '(', ')', '<', '>', 'r', 't', '/'.
    What you actully meant (a string that doesn't contain "</tr>")
    is just achieved by using non-greedy quantifier in <TR>.*?</TR>.
    >
    I can get data0 to work as well as data1,2,3.
    Would it make more sense to split this multiple row
    table by </tr>?Going the second way above, you could find rows using the
    general pattern for TR:
    <tr.*?>(.+?)</tr> and search their contents(i.e. the group#1) using the
    general pattern for TD
    <td.*?>(.+?)</td> Finally, this is the specific pattern for TD that doesn't include the leading
    and trailing tags into group1:
    <td[^>]*>(?:\s*</?[^>]*>)*\s*(.+?)(?:\s*</?[^>]*>)*\s*</td>It succeded in finding
    nicesite
    data1
    data2
    data3
    data
    4
    data5in your sample.

  • FM9 SDL Authoring Assitant Regular Expression Syntax?

    I'm trying to trick SDL into identifying words that are not approved by STE.
    Under "Configure|Style and Linguistic Checks|User Defined Rules" the program allows regular expressions to create custom rules.
    I have all other options in the Utility unchecked.
    I am by no means a pro at regular expressions but was able to create a pretty solid command at http://regexlib.com/RETester.aspx.
    The idea is to create an expression that looks for any word other than those seperated by vertical bars.
    For the test text "this is not the way that should work. this is not the way that should work."
    \b(?:(?!should|not|way|this|is|that).)+
    returns: the work the work
    At that website, I can change the excluded words and it works every time. Change the test text, same thing, still works.
    Perfect! I ripped every approved word in STE into the formula and it (SDL) only returns words at the end of the sentence that are followed by a periods and question marks. So I added"\." to the exclusion list in the expression and it only found words next to question marks. I excluded question marks and now it finds nothing. I don't understand this as I wasn't aware that I had any criteria in the expression that dictates functionality only at the end of the sentence.
    I have an O'reilly book to refer to, if anyone can give me a shove in the right direction as to which set of rules to adhere to, I would appreciate it. Why did negative word matching have to be my introduction to this subject?

    I tried your expression in a couple of regex tools and it seems to parse as you wanted it to. I suspect that the SDL implementation doesn't follow the unix/linux standards. I haven't used the tool and the usage documentation is non-existant, except for the limited flash-based demo.
    From the SDL knowledgebase, it states that their regex filter uses the .NET regex flavour and I believe that the differences on this are explained in the "Mastering Regular Expressions" book.

  • ACE20 Module, webservices and regular expressions.

    Hello All,
    I am trying to loadbalance requests for webservices in a serverfarm. But for some reason, ACE20 module y not making matches on the requests.
    We have a serverfarm Prod1 with 2 real servers and another serverfarm named WSDL with other 2 real servers.
    The idea is the following, if we receive the following string, /App.WebService, the ACE should redirect it to serverfarm Prod1, but if it receives /App.WebService?wsdl, it should be redirected to WSDL.
    Request with string /App.WebService --------------> ServerFarm Prod1
    Request with string /App.WebService?wsdl -----> ServerFarm WSDL
    We use regular expression in L7 class maps to make the loadbalance to happen.
    class-map type http loadbalance match-all APP.WEBSERVICES-L7-SLB
      2 match http url /App\.WebService\?wsdl
    class-map type http loadbalance match-all APP-L7-SLB
      2 match http url /App\.WebService
    policy-map type loadbalance first-match L7_SLB-POLICY
      class APP.WEBSERVICES-L7-SLB
        serverfarm WSDL
      class APP-L7-SLB
        serverfarm Prod1
      class L4_SLB_DATAPOWER(9050)
        loadbalance vip inservice
        loadbalance policy L7_SLB-POLICY
        loadbalance vip icmp-reply
        appl-parameter http advanced-options HTTP_PARAM
        ssl-proxy server wildcard.test.org
        connection advanced-options TCP_PARAM
    But the ACE20 Module seems to be removing the ?wsdl from the URL and only the class-map called APP-L7-SLB is being matched.
    Any comments or suggestions on why this could be happening?
    Thanks in advance,
    Fernando

    Hello Kanwal and all,
    Finally, after reading and reading I found a fix to this problem. Seems that the HTTP protocol uses the question mark (?) character as a delimiter for data appended to the URL. So, if you get the following:
    www.test1.org/App.WebService?wsdl
    If you configured a L7 class map to parse the URL, it will only parse until the question mark (?).
    So you need to create a PARAMETER-MAP changing the URL delimiter start. Here is an example:
    parameter-map type http HTTP_PARAMETER_MAP_WSDL
      persistence-rebalance strict
      set secondary-cookie-delimiters ;!@?
      set secondary-cookie-start ;
    I used the semicolon ( ; ) as delimiter.
    Hope this helps.
    Fernando

Maybe you are looking for