Custom reg-exp classes?

Does anyone know of a way to define custom regular expression classes in Java? For example, they have \p{Upper} for uppercase alpha chars. What I'd like to be able to do is create user-defined type that I could use within several more complex expressions instead of typing the whole long base again.
\p{MyBase} = [A-Z]{1,4}|[A-Z]{4}[A-Z&&[^X]]
then use it like
\p{MyBase}\\.[A-Z]{1}
\p{MyBase}/[A-Z]{1}
\p{MyBase}-[A-Z]{1}
(I know I could do ORs for the 3 situations, but I need to determine them separately.)
thanks

The only Java regex tool I know of that includes this capability is the stevesoft package. The best you can do with the JDK regex package is to build the regex from String fragments as needed, which isn't much of a solution.

Similar Messages

  • Reg: Update of Business address in contact of customer using CMD_EI_API class

    Hello All,
    I am able to insert contact details for the existing customer using the class CMD_EI_API.
    While trying to update existing contact I am not able to update the business address of the contact(T1_
    * structures are used to insert/update the business address), but able to update for person details(T3_* structures are used to update the normal address).
    While creating the contact I am able to add the Business address properly, but while updating the contact business address details are not changed.
    I am also not getting  any errors form the API and also the the function module 'ADDR_MAINTAIN_COMPLETE' which is used to update the address details.
    With regards,
    Sandeep Akella

    Hello All,
      For an existing customer we need to pass the contact that needs to be updated only.
    T1_ADDRESS corresponds to Business address
    T2_ADDRESS corresponds to Home address
    T3_ADDRESS corresponds to contact in company address.
    If there are 3 contacts C1, C2 and C3, and you are updating contact C2 then only pass the details of C2 along with the details of customer.
    Similarly, If you are adding a new contact C4 then pass details of C4 only.
    With regards,
    Sandeep Akella

  • Reg Exp won't make a match with metacharacters?

    Hi All,
    I'm trying to implement a filefilter using regular expressions to allow wildcard searches. Here is the code I have so far. Works fine for a literal match, but if i enter a wildcard search (eg. abc123) it will not list any files, even though if I enter the full name for a file, it matches just fine. Anyone got any ideas because I'm just comming up blank?
    thanks!
    package dbmanager2;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.regex.*;
    * @author nkelleh
    public class LotDialog
        // Declare variables
        private String[] dirFiles;
        // Class constructor
        public LotDialog(String path, String name)
            // Create new file object based on path name given
            File dir = new File(path);
            // Assign file names to string array
            dirFiles = dir.list(new stdfFilter(name));
        public void printFiles()
            for (String files : dirFiles)
                System.out.println("File is " + files );
        class stdfFilter implements FilenameFilter {
            Pattern pattern;
            public stdfFilter(String search)
                // Replace wildcard, '*', with reg exp, '.*'
                search = search.replaceAll("\\*", ".*");
                search = search.replaceAll("\\?", ".");
                pattern = Pattern.compile(search);
                System.out.println(pattern.pattern());
            public boolean accept(File dir, String name)
                if (new File(dir,name).isDirectory())
                    return false;
                else
                    // Return true if a match is found
                    Matcher matcher = pattern.matcher(dir.getName());
                    return matcher.matches();               
    }

    LeWalrus wrote:
    Hi All,
    I'm trying to implement a filefilter using regular expressions to allow wildcard searches. Here is the code I have so far. Works fine for a literal match, but if i enter a wildcard search (eg. abc123) it will not list any files, even though if I enter the full name for a file, it matches just fine. Anyone got any ideas because I'm just comming up blank?
    ...Try debugging your code. A good place to start is to print the following to see where things go wrong:
    public boolean accept(File dir, String name)
      if (new File(dir,name).isDirectory())
        System.out.println("Ignoring: "+new File(dir,name));
        return false;
      else
        Matcher matcher = pattern.matcher(dir.getName()); // shouldnt that be 'name' instead of 'dir'?
        System.out.println("Accept: "+dir.getName()+"? "+matcher.matches());
        return matcher.matches();               
    }

  • Creation of Customer master using CLASS( 'MAINTAIN_BAPI')..

    I am creating customer master by class 'MAINTAIN_BAPI'.  So all fields are sucessfully created except the field 'Remarks / Comments' on customer..Please suggest for the same as far as posiible..
    << Moderator message - Everyone's problem is important. But the answers in the forum are provided by volunteers. Please do not ask for help quickly. >>
    Edited by: Rob Burbank on Jul 18, 2011 10:06 AM

    Hi Yogesh,
    Hi,
    sorry to reply after the message closure.
    Maybe you will read it.
    SD_CUSTOMER_MAINTAIN_ALL is used in standard during the maintenance of a consumer using the standard customer master data transaction XD01 & XD02.
    It is not intended to be used out of the transaction and in no case it should be used out of its original context. Due to the specificity of the function module, out of the original context we may face limitations and data inconsistencies.
    For the maintenance of customers, there is NO BAPI and NO direct function module.
    There are some functions modules like the one above where the name is looking nice. But these should not be used.
    BAPI_CUSTOMER_CREATEFROMDATA1 is part of them. This one uses SD_CUSTOMER_MAINTAIN_ALL, so the above remark is still valid. Moreover, this BAPI is to be used only from process  SAP Product Catalog. Out of it and due to its limitation, a lot of troubles are expected.
    Sorry.
    Below ECC 2005 (6.00), the only solution was batch input and DEBMAS idocs. See [note 384462|https://service.sap.com/sap/support/notes/384462]
    Starting with ECC 2005 (6.00) and above: a synchronisation tool has been introduce. See class CMD_EI_API and VMD_EI_API
    Hope this helps.
    BR
    Alain

  • How to import custom java jar/class into oracle to be used in java proc ?

    Hi
    I would like to know how to import custom java jar/class files into oracle to be used in java stored procedure.
    I am developing a oracle pl/sql procedure to call java program. The java program will be created as procedure and will be published.
    But, my question is that I do have a other external jar/class file that need to be imported into this java program.
    example
    raise_sal.java
    import java.util.*;
    import oracle.sql.*;
    <<reference other java programs >>
    import cmpmsgsvc.xxxx.* ;
    import cmpmsgsvc.yyyy.* ;
    import cmpmsgsvc.zzzz.* ;
    how do I import the cmpmsgsvc jar/class file into oracle so that I don't have any
    compilation errros on raise_sal.java program ??
    what are the steps to import/compile and validate to do this?
    thanks for your help in advance.
    Thanks
    rrb.

    Kuassi
    Problem is that, I have 6 jar files that are needed to be included in the main java program. And, there are more than 50+ classes, propertiers in those 6 jar files.
    It might be not good idea to have all those 50+ classes in the production database.
    Is there anyway that I keep all those 6 jar files in unix box (our's is oracle erp installation with oracle being installed on unix box) and just refer them in the main java program. I mean database will be loaded with main java program and it should able to refer other 6 jar files from unix.
    if we create a directory and keep all jar files in there and include that directory in classpath variable, does this works? or what is other method?
    Please let me know.
    Thanks

  • Custom worklist decorator class not working

    hi , i was trying out the worklist customization as described in http://download.oracle.com/docs/cd/E13154_01/bpm/docs65/workspace_customization/index.html. however it is not working. any ideas as to what might be wrong...
    my custom mworklist decorator class is almost the same as that described in the example -
    package customization;*
    import fuego.lang.Interval;*
    import fuego.lang.Time;*
    import fuego.papi.InstanceInfo;*
    import fuego.papi.Presentation;*
    import fuego.papi.VarDefinition;*
    import fuego.workspace.model.view.WorkListDecorator;*
    import java.util.Locale;*
    public class CustomWorkListDecorator*
    +implements WorkListDecorator {+*
    +public String getRowStyle(String viewId, InstanceInfo instanceInfo, int rowIndex) {+*
    return  "background-color:Red" ;*
    +}+
    public String getCellStyle(String viewId, InstanceInfo instanceInfo,*
    +Presentation.Column column, int rowIndex) {+*
    return null;*
    +}+
    public String getValue(String viewId, InstanceInfo instanceInfo, Presentation.Column column,*
    +Locale locale, String currentValue, int rowIndex) {+*
    String result = currentValue;*
    +if (column.getId().equals(VarDefinition.RECEIVED_ID)) {+*
    Time receptionTime = instanceInfo.getReceptionTime();*
    Time today = Time.now();*
    +if (receptionTime.getDate().equals(today.getDate())) {+*
    Interval relativeTime = Time.sub(today, receptionTime);*
    int relativeHours = relativeTime.getHoursOnly();*
    int relativeMinutes = relativeTime.getMinutesOnly();*
    String relativeTimeString = relativeHours > 0 ? relativeHours " h " + relativeMinutes + " m" :+*
    relativeMinutes " m";+*
    result = "<table><tr><td nowrap class=bpmWorkspaceNormalText>" +*
    +"<img src='/workspace/img/time.gif'/> Today " ++
    +"(" + relativeTimeString + " ago)</td></tr></table>";+
    +}+
    +}+
    return result;*
    +}+
    +}+

    my workspace.prop file content--\
    +#+
    +#+
    +#+
    +#--------------------+
    +# Directory Settings+
    +#--------------------+
    +# The directory ID that identifies the directory ALBPM WorkSpace connects to.+
    fuego.workspace.DIRECTORY_ID=default
    +# Specifies a remote location for the directory configuration file.+
    +#remote.config.url=http://forums/remoteConfig/directory.xml+
    +# The PRESET ID WorkSpace uses to authenticate against the servlet container.+
    fuego.workspace.container-auth.directory.preset=container-auth
    +#--------------------+
    +# WorkSpace Settings+
    +#--------------------+
    +# Not used in this version.+
    fuego.workspace.autoRefreshMenuOption=false
    +# Not used in this version.+
    fuego.workspace.refreshTimeMin=1
    +# Enables debug mode.+
    fuego.workspace.debug=false
    +# WorkSpace HTTP debugger port.+
    fuego.workspace.debuggerPort=9007
    +# WorkSpace bean helper. This class should implement the interface fuego.workspace.adapter.WorkspaceBeanHelper.+
    fuego.workspace.bean.helper.className=fuego.workspace.adapter.DefaultWorkspaceBeanHelper
    +# Enables Cookie Persistence for panel preferences+
    +# (Only supported for view selections)+
    fuego.workspace.cookie.persistence.enabled=false
    +# Specifies the timeout period in seconds, between client requests.+
    +# If not specified the default value is 45 minutes.+
    +#fuego.workspace.sessionTimeOut=2700+
    +#---------+
    +# Logging+
    +#---------+
    +# Specifies the level of detail of the information stored in the ALBPM logs.+
    fuego.log.workspace.severities=fatal,severe,warning,info,debug
    +# The detail level filters messages that correspond to the same severity. It can vary from 1 to 10.+
    +# The default detail level is 5.+
    fuego.log.workspace.detailLevel=10
    +# The location where the log files are stored.+
    fuego.log.workspace.file=E:/oracle_bpm/log/workspace.log
    +# Defines the format of the information of the first line of a log entry.+
    +fuego.log.workspace.format='[<{SEV}> 'MMdd HH:mm:ss.SSS'] {MOD} ({THR}): {INDENT}{MSG}'+
    +# Defines the format of the information of the lines that follow the first line in a log entry.+
    +fuego.log.workspace.continuationFormat='[     (cont)     ] {MOD}: {INDENT}{MSG}'+
    +# Enables OpenLog (PTSpy remote debugging)+
    fuego.workspace.enableOpenLog=true
    +#------------------------------+
    +# Process Execution Properties+
    +#------------------------------+
    +# If the current activity has the autocomplete property set to true, execute the next activity if the current user has+
    +# the required role to do so.+
    fuego.workspace.execution.performNextActivity=false
    +# Waiting time for Automatic activities in a screenflow in milliseconds. If an activity exceeds this time, the+
    +# screenflow is aborted.+
    fuego.workspace.execution.waitForAutomatics=3000
    +# Display external activities in a pop up window.+
    fuego.workspace.execution.external.newWindow=
    +#-----------------------+
    +# Process API Settings+
    +#-----------------------+
    +# Number of instances in PAPI cache.+
    +# If not defined the default value is 200.+
    fuego.workspace.papi.instancesCacheSize=10000
    +# Maximum number of participants that the API will return when performing a single query.+
    +# If not defined the default value is 500.+
    fuego.workspace.papi.maxParticipants=500
    +#----------------+
    +# Single Sign On+
    +#----------------+
    +# Enables Single Sign On (SSO).+
    fuego.workspace.enableSSO=false
    +# Custom SSO class full name. This class must implement fuego.workspace.security.SSOWorkspaceLoginInterface.+
    fuego.workspace.SSO.loginClassName=fuego.workspace.security.SSOWorkspaceLogin
    +#-------------------------+
    +# WorkSpace Customization+
    +#-------------------------+
    +# CSS file that defines ALBPM WorkSpace style.+
    fuego.workspace.stylesheet=bpmworkspace.css
    +# Image bundle file.+
    fuego.workspace.imageBundleFile=ImagesBundleSet1
    +# JSP bundle file.+
    fuego.workspace.jspBundleFile=JSPBundle
    +# Help bundle file.+
    fuego.workspace.helpBundleFile=HelpBundle
    +# Custom messages bundle file.+
    +#fuego.workspace.customMessageBundle=MyMessageBundle+
    +# Enables WorkSpace edition mode.+
    fuego.workspace.enableEditMode=true
    +# Enables WorkSpace listeners configuration.+
    fuego.workspace.enableConfigurableListenerMode=true
    +# Enables WorkSpace layout edition.+
    fuego.workspace.enableLayoutEdition=true
    +# Custom Work List Panel Decorator.+
    fuego.workspace.worklist.styleResolverClassname=customization.WorkListDecoratorImpl
    +# Custom Work List Bulk Operations.+
    +#fuego.workspace.worklist.customOperationClassname=fuego.workspace.example.MyWorkListCustomOperations+
    +# Length of the description and filename column in the Attachments table, in characters.+
    fuego.workspace.attachments.contentLength=12
    +# Theme used to display process images and activity icons.+
    +# Available values: Classic, BPMN, ColorBPMN, BusinessAnalyst and UML+
    fuego.workspace.processImageTheme=ColorBPMN
    +# Default execution type for Applications and Work List panels.+
    +# Possible values: DIALOG, POPUP+
    fuego.workspace.defaultExecutionType=DIALOG
    +# Specifies if execution dialogs are displayed maximized.+
    +# If set to false, it uses the defined width and height.+
    fuego.workspace.executionDialog.maximize=false
    +# Execution dialog width.+
    fuego.workspace.executionDialog.width=500
    +# Execution dialog height+
    fuego.workspace.executionDialog.height=600
    +# Execution popup width.+
    fuego.workspace.popupWindows.width=800
    +# Execution popup height.+
    fuego.workspace.popupWindows.height=600
    +# Defines the WorkSpace search scope policy.+
    +# Possible values: ALL, ALL_IN_ROLE, PARTICIPANT_ROLES, PARTICIPANT+
    +# Multiple policies should be separated with commas. The first value is WorkSpace default selection.+
    +# If not defined WorkSpace uses ALL policy.+
    +#fuego.workspace.search.rolePolicyScopes=ALL,ALL_IN_ROLE,PARTICIPANT_ROLES,PARTICIPANT+
    +# Enables AJAX execution for interactive components.+
    fuego.workspace.execution.ajax.enabled=true
    +# Enables Views edition.+
    fuego.workspace.views.editable = true
    +# Orientation of the audit trail process image.+
    +# Possible values: auto, vertical, horizontal.+
    fuego.workspace.auditTrail.processImageOrientation=auto
    +# Show bookmarks column+
    fuego.workspace.showBookmarksColumn=true
    +# Filters case sensitive property default value.+
    fuego.workspace.filter.caseSensitive=false
    +#-----------------------+
    +# RSS Feeds Application+
    +#-----------------------+
    +# Enables Feeds link in WorkSpace.+
    fuego.workspace.feedLinkEnabled = true
    +# Enables URL guessing for the RSS Feeds application.+
    fuego.workspace.feedUrlGuessing = true
    +# RSS feed URL. If guessing is not enabled this URL is used.+
    fuego.workspace.feedUrl=http://localhost:8080/feeds/
    +#------------------------------+
    +# WorkSpace Extension Settings+
    +#------------------------------+
    +#ALBPM WorkSpace Extension wizard uses the following properties to store configuration properties.+
    +# YOU MUST NOT MODIFY THEM MANUALLY.+
    fuego.workspace.imageServer=
    fuego.workspace.enableWE=false
    fuego.workslace.collaboration.supportedLanguages=af, sq, ar, eu, be, bn, bg, ca, zh_CN, zh_TW, kw, hr, cs, da, nl, en, eo, et, fo, fi, fr, gl, de, el, he, hi, hu, is, id, ga, it, ja, kl, ko, lv, lt, mk, mt, gv, mr, nb, nn, fa, pl, pt, ro, ru, sr, sk, sl, es, sw, sv, ta, te, th, tr, uk, vi
    +# DO NOT REMOVE THIS LAST LINE+

  • Custom page controller class

    Hello,
    I'm trying to implement what is explained in the article *"Two Ideas to Handle JBO-35007 'Row Currency Changed' Exception"* (http://blogs.oracle.com/smuenchadf/examples/). This example illustrates how to use a custom page controller class to override the handleError() method to conditionally handle the JBO-35007 exception ('Row currency has changed since the user interface was rendered.') in a way that might be more useful to the end-user.
    So I've defined a custom page controller class in a JSP of my application, but I don't know why the application flow is not passing through the handleError method when a JBO-35007 exception occurs.
    I've defined well in the pagedef the attribute "ControllerClass", and I use the "back button" to produce the JBO-35007 exception. But I don't know why the method handleError is not executed, although the the JBO-35007 exception is displayed.
    Thank you very much.

    Hi,
    you are on JDeveloper 11g ? The article you follow was written for 10.1.3. In 11g the error handling is configured in DataBindings.cpx page. Select the DataBindings.cpx page in the Application Navigator and select its root node in the Structure Window. Then open the Property Inspector to configure your version of the Error Handler class
    Frank

  • Access Custom Configuration Item Class property in Data Warehouse database

    Is there a way to access properties on a custom 'Configuration Item Class' in the DW database?
    When creating a new CI class eg. 'Monitors' and extending this with a property like 'Serial' is there a way to access this in the DW database?
    I can find Displayname and AssetStatus in the ConfigItemDim table, but is there a way to get the other custom created properties?

    Ok !
    Are you read this post ? :
    http://social.technet.microsoft.com/Forums/systemcenter/en-US/8434e129-b969-451e-875c-f120d7b31d36/dw-reporting-on-custom-class?forum=systemcenterservicemanager
    Remy BOVI

  • Customer Defined Data Classes on Cluster Tables?

    Hi all,
    I noticed that there is no option within db13 to change the storage option to a customer defined data class, for cluster tables. I am sure this is by design but wanted to check to see if anyone has had any luck defining a data class on a cluster table.
    We could move a cluster table to a DB2 tablespace and define the new Data Class through dbacockpit/db02, but there is no option to change the data class definition in the data dictionary (se13) to use the new Data Class for the table itself.
    Mainly what we are aiming for is to be able to move 2 tables into their own tablespaces on the target server, during a migration. Sapinst is looking at the Data Classes to create DDLDB6.XML, which defines the tablespace assignments to the target server, so perhaps there is a preferred method of making this change, if it does exist.
    Thanks for any insights,
    Derek

    Hi guys,
    Thanks for the helpful answers. I should add some more detail.
    Our tablespaces have already been moved to new tablespaces on the source system, with DB6CONV, and we have updated our data classes through db02, with no problems. So sapinst uses the data class definitions to create the custom tablespaces, and then uses the data class assignments to assign the table to a tablespace.
    However, the cluster tables do not seem to support the data class assignment in se13, the option is not available as it is for normal tables. Let me see if I can post a screenshot somewhere with a cluster table versus a normal table. For example, there is no option to change the data class for table CDCLS in se13.
    I am wondering if this is a limitation of the version of R/3 we are using, or if the limitation for cluster tables is something that is intended on all versions of R/3.
    If we can't use db13 to make the assignment, we may try the custom definition in the STR file as Kiran mentioned.

  • A doubt on REG EXP

    Hi friends,
    Please clarify the following doubt in Reg Exp.
    Table EMP has following EMP_NAMEs:
    ============
    Anand
    Bala_G
    Chitra
    David_C
    Elango
    Fathima
    ============
    We have a set of characters as "abcdefghijklmnopqrstuvwxyz0123456789".
    Now we need to find the count of EMP_NAMES whose characters (any) are not in the list of characters in the above list. In this example, the result should be 2. i.e., 'Bala_D' and 'David_C'. The query should be like:
    Declare
    v_string varchar2(50) := 'abcdefghijklmnopqrstuvwxyz0123456789';
    v_count number(6);
    Begin
    select count(*)
    into v_count
    from emp
    where regexp_like(emp_name, v_string);
    dbms_output.put_line(v_count);
    end;
    ========================
    Thanks in advance!

    Hi,
    Welcome to the forum!
    To use REGEXP_LIKE, you could say:
    WHERE     REGEXP_LIKE ( emp_name
                  , '[^abcdefghijklmnopqrstuvwxyz0123456789]'
                  )However, it will be faster not to use regular expressions:
    WHERE   LTRIM ( emp_name
               , 'abcdefghijklmnopqrstuvwxyz0123456789'
               )          IS NOT NULLEdited by: Frank Kulash on Oct 10, 2012 4:18 PM
    Removed extra single-quote, after DAMorgan, below.

  • How to make Matcher stop once a reg exp match is found

    Is there a way to make the regular expression Matcher stop reading from the underlying CharSequence once it finds a match? For example, if I have a very long String and a match for some regular expression is at the beginning of the String, can I make the Matcher object stop examining the String once it finds the match? The Matcher object seems to always examine the entire CharSequence, even if a match is very near the beginning.
    Thanks,
    Zach Cox
    [email protected]

    Nope, {1}+ doesn't work either. I know it's
    continuing because I created my own CharSequence
    implementation that just wraps a String orwhatever,
    and I print to System.out whenever Matcher callsthe
    charAt method.What about the lookingAt() method?I think lookingAt is like matches, except just the beginning of the CharSequence has to match (i.e. starting at index 0), not the entire thing. I tried it and it doesn't even find the reg exp. The find method at least finds the reg exp, it just reads too far.

  • Custom non-PersistenceCapable classes used as keys in Maps and/or SortedMaps?

    Hi all,
    I need to support custom non-PC classes as keys in SortedMaps. It takes
    custom coding to the Kodo API right now, and before embarking down that
    road, I wondered if anyone out there has already done this and is willing
    to share that code.
    Thanks!
    --matthew

    Matthew-
    Can you just make the key implement Serializable and store it as a blob
    (which means that you will not be able to query against it), or do you
    have other restrictions?
    In article <c90i4b$22k$[email protected]>, Matthew T. Adams wrote:
    Hi all,
    I need to support custom non-PC classes as keys in SortedMaps. It takes
    custom coding to the Kodo API right now, and before embarking down that
    road, I wondered if anyone out there has already done this and is willing
    to share that code.
    Thanks!
    --matthew--
    Marc Prud'hommeaux
    SolarMetric Inc.

  • Reg Exp - not as expected

    Not often I ask questions myself, and perhaps my mind's just gone fuzzy this morning, but I'm having trouble doing a simple replace with regular expressions...
    In the below example I just want to replace all occurences of "fred" with "freddies"...
    SQL> ed
    Wrote file afiedt.buf
      1* select regexp_replace('this freddies is fred fred record', 'fred', 'freddies') from dual
    SQL> /
    REGEXP_REPLACE('THISFREDDIESISFREDFREDRECORD'
    this freddiesdies is freddies freddies recordbut, obviously, I don't want the existing "freddies" to become "freddiesdies", it should stay as it is. So if I check for spaces either side of the search string (and take account of it maybe being at the start/end of the string...
    SQL> ed
    Wrote file afiedt.buf
      1* select regexp_replace('this freddies is fred fred record', '(^| )fred( |$)', '\1freddies\2') from dual
    SQL> /
    REGEXP_REPLACE('THISFREDDIESISFREDFRE
    this freddies is freddies fred record
    SQL>It no longer replaces the "freddies" incorrectly, BUT it only replaces the first occurence of "fred" with "freddies" and not the latter one. ?!?!?!
    If I put an extra space inbetween the two "fred"s then it works:
    SQL> ed
    Wrote file afiedt.buf
      1* select regexp_replace('this freddies is fred  fred record', '(^| )fred( |$)', '\1freddies\2',2) from dual
    SQL> /
    REGEXP_REPLACE('THISFREDDIESISFREDFREDRECO
    this freddies is freddies  freddies record
    SQL>But I'm not going to have double spaces between the words and I can't determine where to insert them to make it work like this so it's not a feasible solution, although it does seem to highlight that the regular expression parser is not taking the space after the first match in the context of being the space before the second match.
    Is that a bug in the regular expression parser, a feature of the way regular expressions work (i.e. expected) or am I doing something wrong with my search and replace reg.exp. strings?
    Cheers

    I think this will explain ..
    SQL> select regexp_replace
      2         ('this freddies is fred fred  fred record',
      3          '(^| )(fred)($| )','\1freddies\3') str
      4  from dual
      5  /
    STR
    this freddies is freddies fred  freddies record
    1 row selected.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Reg Exp always returning false value

    Hi,
    Below is my code. I want to restrict the values to only alphabets and numbers and not special char.
    But the below condition fails on a positive value also. Ex: ABCD, abcd, 1234. These should be acceptable.
    Is the reg exp wrong?
    private var special_char:RegExp = /^[A-Za-z0-9]*$/;
                                  private function validateSpecialChar(inputValue:String):Boolean {
                                            if (special_char.test(inputValue))
                                                      valid = true;
                                            else
                                                      valid = false;
                                            return valid;
    Thanks,
    Imran

    Try: http://stackoverflow.com/questions/9012387/regex-expression-only-numbers-and-characters

  • REG EXP pattern ?

    Hi Folks;
    I need to create a reg exp pattern with these rules :
    mpexprfinal      : mpexprUnit(\ OROP\ mpexprUnit)*
    mpexprUnit      : mp(\ AND\ mp)*minusplusexpr
    minusplusexpr :     "\ \(+\)\ " or "\ \(-\)\ "
    mp : "[A-Z]{1}[0-9]{6}" (ex: I123456)
    OROP : ","
    Help me please!
    Edited by: Moostiq on 2 mai 2011 16:52
    Edited by: Moostiq on 2 mai 2011 16:52

    Hi,
    I don't know of any really good way to assign names to sub-patterns in a regular expression, and then use those names in bigger expressions.
    You can (sort of) do the same thing in SQL, by assigning column aliases to string literals (as in def_1, below), or concatentions of literals and previouslly defined aliases (as in def_2):
    WITH     def_1         AS
         SELECT     '\(\+|-\)'          AS minusplusexpr
         ,     '[A-Z]{1}[0-9]{6}'     AS mp
         ,     ';'               AS orop
         FROM     dual
    ,     def_2        AS
         SELECT  def_1.*
         ,     mp || '( AND '
                 || mp
                 || ')*'          AS mpexprunit
         FROM    def_1
    SELECT     x.*
    FROM          table_x     x
    CROSS JOIN     def_2     d
    WHERE     REGEXP_LIKE ( x.txt
                  , d.mpexprunit || '('
                                 || d.orop
                           || '|'
                           || d.mpexprunit
                           || ')*'
    ;Take this as pseudo-code. I'm not sure it will do anything. (I can't test it until you post some sample data).
    If it does run, I'm not sure it will do what you want (since you haven't explained what you want).
    You may find it easier just to repeat the expressions in your code. An approach like the one above is most useful when the definitions (mp, mpexprunit, and so on) change frequently.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using. I'm not sure you'll need any features that were added after Oracle 10.1, but why take a chance?

Maybe you are looking for

  • How do I get rid of the menu bar icon on Mac OS?

    The Creative Cloud menu bar icon on Mac OS is pretty much useless since I already have icons for all the apps and don't use Adobe Cloud storage. Anyone know how to get it off my menu bar? The menu bar is MY space. I ought to have control over what go

  • Utilizing item category ALEN - Creation of PO is not auto generated

    All, I am utilizing item category ALEN during my sales order creation process.  ALEN is set up with "create purchase order automatically" flag.  I am utilzing schedule line CB and I have maintained the order type NB, item category is 0 and acct. assi

  • Movement type 501 in MIGO doing GR for FG Product

    I am using movement type 501 in MIGO doing GR for FG Product, at that time its giving error 'no manual posting allow to GL Account' We dont want to allow any manual posting in this GL . Can be configure this Movement type like that whenever we do GR

  • Distribution Model (ALE) - Message type has to be deleted from model view

    Hello, I want to delete a message type from an existing model view in the distribution model (of the maintenance system). But when I mark the concerning message type and press Edit->Delete the message 'Action cannot be carried out on the nodes select

  • ALE IDOC Error 29 - Error in ALE Services

    Hi Friends, We are getting error No 29 in ALE Services. In WE20 we created partner profiles and did all the ALE setup activities. Finally we went for post process permit in we02 and we found - Error 29 Error in ALE services. We checked our partner nu