What is regular expression for cheking a set operation

I want a regular expression for checking the syntax of the set operation given as input
ex:
the input should be
[1,2,3]+[2,3] or [1,2]-[2] or [1,2,3]*[1,2]
is should check the square bracket and the operator between two set operands

I think you should code that from scratch. When you validate input, you usually want to tell the user what they did wrong, but a regex will only tell you whether it matches or not.

Similar Messages

  • What is the regular expression for the end of a story?

    Forgive me if this is wrong forum for asking this, but I'm trying to use the Find command using GREP and I need to know the regular expression for the end of a story. (Or, the last character of a story.) Thanks in advance.

    I'd try search for .\z (that's a dot in front) which ought to find the very last character in the story, and replace with $0 and your additional text.
    You know you can use a keyboard shortcut to move your cursor to the end of any story, right? Ctrl + End on Windows, Cmd + End, I think, on Mac. Unless you want to do this to every single story in the document, I would think you might be just as well off to put your text on the clipboard, put the cursor in the story and hit the key combo followed by Ctrl/Cmd + V to paste.

  • Wat should be the regular expression for string MT940_UB_*.txt to be used in SFTP sender channel in PI 7.31 ??

    Hi All,
    What should be the regular expression for string MT940_UB_*.txt and MT940_MB_*.txt to be used as filename inSFTP sender channel in PI 7.31 ??
    If any one has any idea on this please let me know.
    Thanks
    Neha

    Hi All,
    None of the file names suggested is working.
    I have tried using - MT940_MB_*\.txt , MT940_MB_*.*txt , MT940*.txt
    None of them is able to pick this filename - MT940_MB_20142204060823_1.txt
    Currently I am using generic regular expression which picks all .txt files. - ([^\s]+(\.(txt))$)
    Let me know ur suggestion on this.
    Thanks
    Neha Verma

  • The post-expression for the step 'Set Station Global Models' could not be evaluated.

    When running a TestStand sequence, I get the following error message:
    The post-expression for the step 'Set Station Global Models' could not be evaluated.
    Variable or property types do not match or are not compatible.
    Error Code:  -17321; Variable or property types do not match or are not compatible.
    Although I do understand what the above is telling me, fixing the root cause is somewhat another thing.
    I'll explain the scenario.  The code is developped in TS4.1.0, although that should be irrelevant.
    I inherited a TestStand project which calls LabVIEW modules.  The original sequence works fine on the test pc (which is remotely located).  The local and remote PC's share the same StationGlobals.ini.
    Here is why it is strange..  I do get the error message on the local PC whether I use the old or the new code.  I was assuming that using the same StationGlobals.ini would have fixed that, but it didn't. 
    When I run the old code on the remote PC, I do not get that message, but I do get it with the new code.  I don't recall modifying code that affected the StationGlobals.  My goal is to fix it on both machines (at least the remote one).
    This is the expression that it does not like:
    StationGlobals.Models=Locals.Models,
    However, that very same expression exists in the original code.  The one thing that did change is the addition of a new model number in the Locals.Models.newNumber.  I suspect that this contributes to the error.  But why does it give me an error when I run the original sequence locally?  Maybe I should try running it again..
    In either case, any suggestions to overcome the error?
    Thanks.
    RayR
    Solved!
    Go to Solution.

    Please ignore post.
    I found the problem..  There was a mismatch with the number of models.  Easy fix.  It's all good.
    For someone else who might tumble onto this thread for the same reason, here's an explanation.
    I added a new model with its variants to the list of Locals.Models.  In total, there were 16 additions to the list.
    I also added these to the StationGlobals.  Which meant that my StationGlobals no longer matched the one on the remote PC. 
    Where the error came in is that there was one missing model in the StationGlobals, so the size (number of models) did not match that of the Locals. 
    Slight oversight in the sea of models that are listed (I'm not even going to count them).  Now fixed. 
    ... and embarrassed ...
    I may as well give myself an "Accepted Solution".
    Spoiler (Highlight to read)
    Since I've been naughty all year it will be my only Christmas gift..
    Since I've been naughty all year it will be my only Christmas gift..

  • Regular Expression for a Person's Name

    Hi,
    I am using the org.apache.regexp package and trying to find the regular expression for a person's name. It allows only the alphabetic string.
    I tried [a-zA-Z]+. But this also accepts the thing like "BUSH88", which is not what I want...
    Can anybody help me figure this out?
    Thanks in advance,
    Tong

    Hi,
    I am using the org.apache.regexp package and trying to
    find the regular expression for a person's name. It
    allows only the alphabetic string.
    I tried [a-zA-Z]+. But this also accepts the thing
    like "BUSH88", which is not what I want...
    Can anybody help me figure this out?
    Thanks in advance,
    Tongtry this:
    ^[a-zA-Z]+$
    the ^ represents the start of the String and the $ represents the end.
    So the expression is saying: "between the beginning and the end of the String there will only be alphbetical characters"

  • Regular expression for DBCC

    Hi Everyone,
    I need help with regular expression for following scenario .
    If any of the DBCC command is run against sql server i want it to be captured . Something like if it starts with DBCC it should be captured .
    For instance following is expression for
    DBCC CheckDB : part="dbcc checkdb", rgxp="(\s|;|^)dbcc\scheckdb\s?\((((to[a-z0-9_\$\#\.\@])|(t[abcdefghijklmnpqrstuvwxyz0-9_\$\#\.\@])|([abcdefghijklmnopqrsuvwxyz]))[a-z0-9_\$\#\.\@]*)\s?\)(\s|;|$)"
    But instead of writing expression for all DBCC commands is there any way to write a regular expression say if  DBCC i want it to be captured .
    Thanks
    Suhas Vallala

    Hi Suhas,
    As Olaf said, regular expressions is not supported in SQL Server. To trace the DBCC event, you can use the SQL Sever Profiler, just tick the Security Audit--> Audit DBCC Event. You can set up a trace in the profiler by following the below tutorial.
    SQL SERVER – Introduction to SQL Server 2008 Profiler
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • How to form a regular expression for matching the xml tag?

    hi i wanted to find the and match the xml tag for that i required to write the regex.
    for exmple i have a string[] str={"<data>abc</data>"};
    i want this string has to be splitted like this <data>, abc and </data>. so that i can read the splitted string value.
    the above is for a small excercise but the tagname and value can be of combination of chars/digits/spl symbols like wise.
    so please help me to write the regular expression for the above requirement

    your suggestion is most appreciable if u can give the startup like how to do this. which parser is to be used and stuff like that

  • Using regular expressions for validation in i18n

    Can we use regular expressions for validation of inputs in a java application taking care of i18N aspects too. Zip code for different locales are different. Can we use regular expressions to validate zipcode inputs from different locales

    hi,
    For that shall i have to create individual patterns for matching the inputs from different locales or a single pattern will do in the case of validating phone nos. around the world, zip codes etc. In case different patterns are required, programmer should have a konwledge of difference in patters for different locales.
    regards
    sdas

  • How to write the regular expression for Square brackets?

    Hi,
    I want regular expression for the [] ‘Square brackets’.
    I have tried to insert in the below code but the expression not validate the [] square brackets.
    If anyone knows please help me how to write the regular expression for ‘[]’ Square brackets.
    private static final Pattern DESC_PATTERN = Pattern.compile("({1}[a-zA-Z])" +"([a-zA-Z0-9\\s.,_():}{/&#-]+)$");Thanks
    Raghav

    Since square brackets are meta characters in regex they need to be escaped when they need to be used as regular characters so prefix them with \\ (the escape character).

  • Need a regular expression for the text field

    Hi ,
    I need a regular expression for a text filed.
    if the value is alphanumeric then min 3 char shud be there
    and if the value is numeric then no limit of chars in that field.[0-9].
    Any help is appriciated...
    thanks
    bharathi.

    Try the following in the change event:
    r=/^[a-z]{1,3}$|^\d+$/i;
    if (!r.test(xfa.event.newText))
    xfa.event.change="";
    Kyle

  • Regular Expression for /, \, #, -, & ‘

    Hi,
    Can anybody tell me the regular expression for provided characters.
    Code is preferable.
    Thanks in advance.

    "[-/\\\\#&']"

  • Regular Expression For Dreamweaver

    I still haven't had the time to really become a professional when it comes to regular expressions, and sadly I am in need of one an finding it difficult to wrap my head around.
    In a text file I have hundreds of instances like the following:
    {Click here to visit my website}{http://www.adobe.com/}
    I need a regular expression for Dreamweaver that I can run within the "Find and Replace" window to switch the order of the above elements to:
    {http://www.adobe.com/}{Click here to visit my website}
    Can anyone provide some guidance? I'm coming up short due to my lack of experience with regular expressions.
    Thank you in advance!

    So you have a string that starts { and goes until the first }.  Then you have another string exactly the same.  And you want to swap them.  I'm not making any assumption that the second one has to look like a URL (that's a whole other minefield, but perhaps you could do something simple like it must start with http). 
    You don't specify how your text file is divided up, have you got this as a complete line to itself, or is it just  a huge block of text?  Preferably as individual lines.
    I don't have Dreamweaver, but this worked for me in Notepad++
    Find: ^{(.*?)}{(.*?)}$
    Replace with: {\2}{\1}
    My file looked like this:
    {Click here to visit my website}{http://www.adobe.com/}
    {some other site}{http://www.example.com/foo}
    And doing a Replace All ended up like this:
    {http://www.adobe.com/}{Click here to visit my website}
    {http://www.example.com/foo}{some other site}

  • Regular expression for LOV?

    I have a list of strings in an LOV. I tried filtering it by typing in "^disk" in the search bar, which I hope will return a list of strings starting with "disk", but I failed.
    Any idea on how to use regular expression for LOVs? Thanks!

    HI Buffalo,
    i have a select list item in my page1 named :P1_EMPNAME with lov query value
    select ename as d, ename as r from emp WHERE EGEXP_LIKE(ename,:P1_SEARCH) or :P1_SEARCH IS NULL
    i have a Search text box in my page1 name :P1_SEARCH
    When i run the page, by default all the empnames will display in the lov list item
    i have given ^buffalo in the text seach item and clicked the submit button ,it shows the Employee buffalo in my list item lov.
    If you want all the entries that start with S, search for ^s
    End with R, use r$
    please try this link http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28424/adfns_regexp.htm
    Thanks
    Logaa

  • Regular Expression for filename

    I want to read XML files,If the filename starts with an alphabet.
    Can anybody tell the regular expression for the same.
    Regards
    V Kumar
    Message was edited by:
    user640551

    thanks dhrmendra,
    i got the solution and correct expression is "[a-zA-z].\*.xml"
    regards
    V Kumar

  • Regular Expression for PathName???

    Anyone have a "ready to go" regular expression for detecting a pathname?
    for example I need to detect the following:
    myfile.txt
    ./myfile.txt
    ../my-file.ini
    /home/my-home/myFile.foo
    etc.
    Now, in a perfect world, it could also do Windows (or ANY OS for that matter) pathnames (though this is not terrbibly important for my case at least).
    TIA,
    /m

    import java.util.regex.*;
    * @author  Ian Schneider
    public class FileRegex {
        static Pattern pattern;
        /** Creates a new instance of FileRegex */
        public FileRegex() {
        public Pattern getPattern() {
            if (pattern == null) {
                pattern = Pattern.compile("([\\/]?(\\w+|\\.|\\.\\.)[\\/])*(\\w+)\\.?(\\w+)?");
            return pattern;
        public String[] parts(String path) {
            Matcher m = getPattern().matcher(path);
            if (m.find()) {
                return new String[] { m.group(1),m.group(3),m.group(4) };
            return null;
        public boolean matches(String path) {
            return getPattern().matcher(path).matches();
        public static final void main(String[] args) throws Exception {
            FileRegex regex = new FileRegex();
            String[] files = {
                "myfile.txt",
                "../myfile.txt",
                "./myfile.txt",
                "/a/b/c/myfile.txt",
                "/a/../myfile.txt",
                "myfile"
            for (int i = 0, ii = files.length; i < ii; i++) {
                System.out.println( files[i] + " match " + regex.matches(files));
    String[] pieces = regex.parts(files[i]);
    if (pieces != null)
    System.out.println(" path : " + pieces[0] + " file : " + pieces[1] + " ext : " + pieces[2]);
    I will leave it to you as an excercise to add support for spaces in path names, different separator characters, etc..

Maybe you are looking for

  • Check for null value for Date Field

    Hello everyone, I have a database that consist of date field and also a bean that will able to access the db. here are my example:- private int setDate(int date) { this.date = date; private void getDate { return date; later, I entered a date value an

  • Can you tell if it is a display problem or logic board problem

    I have a 17 inch aluminum mac book pro. I bought it from a reseller on ebay in February. Recently I have been having some display issues. It has taken it longer and longer for screen to come back on from sleeping and the other day it did not come bac

  • File name in Split messages with Message mapping

    Hi everyone, I split my incoming message into multiple files based on the Order Numbers. Also I have a particular file naming convention I need to use. Its someething like RTG746932746.63749 Now, I have given the field file name along with my target

  • Printing to PDF adds printer margins

    I have an extremely frustrating problem. I have a large Word doc with a full bleed border. I need to convert it to PDF for printing, but when I try, I get "the footer/margins in Section X are outside the printable area of the page." If I hit "ok," th

  • 2600 classic battery live

    Hi, I just bought a 2600 classic. The battery live should be max. 560 hours, but after 4 days I have to recharge. What can be the reason? **mail address deleted by moderator - please use PM system only** Message Edited by romanov on 06-Jan-2009 06:55