Help constructing a Pattern

I have a string that looks like
oneof(val1,val2,val3,...)
where val2 and on (and the comma) are optional.
I need to construct a Pattern that matches this
and allows me to get the values (without the
separating commas).
The static part of the input string is easy to match:
Pattern p = Pattern.compile("oneof\\(\\)");
But I can't figure out the 'val1,val2,...' part.
Something like:
([^,]+)(,[^,])+
But that would retain the comma in the capturing
group. There is the (?:) non-capturing group but
I don't know how to incorporate that.
As an aside question. I can get an individual match
with matcher.group(n) but how do I determine how
many groups were matched (valid values for n)?
matcher.groupCount() isn't it, I don't think, since it
applies to the pattern and not the matched strings.
Thanks for your help.

import java.util.regex.*;
public class Zy
    public static void main(String[] args)
        Pattern p = Pattern.compile("^oneof\\(val1(,val(\\d))*\\)");
        Matcher m = p.matcher("oneof(val1,val2,val3)");
        boolean b = m.matches();
        if (b = true)
            System.out.println("Input val count: " + m.group(2));
}

Similar Messages

  • Please help me install Pattern Maker?

    Hi,
    At this url:
    http://www.adobe.com/support/downloads/thankyou.jsp?ftpID=4687&fileID=4377
    I am trying to download the plugin:
    CS5_Optional_PlugIns_Installer.dmg
    The files included are:
    CS5 Optional Extension Plug-Ins.mxp
    and
    CS5 Optional Plugins.mxp
    When I attempt to install either of these two files, I get the following error message:
    I’m attempting to place the installs into the Applications> Photoshop CS5 > Plugins > Optional Plugins
    I'm on a Mac OS 10.6.5
    What am I doing wrong?
    Thank you so much in advance.
    Linda

    Hi Linda,
    Sorry if I confused, but I just want to make sure that you don't have all the Optional Extensions installed and enabled (as fallout from trying to get Pattern Maker working). There are two .mxp files and you mentioned trying to install both of them. I haven't seen the actual error you get, so to be safe, I'm suggesting that you make sure to disable all the Optional Extensions (and likely all the optional plug-ins that you don't need too). The installers are/were all or nothing (I'm not sure if the installer .mxp for Optional Extensions has been removed yet).
    The quickest way to uninstall is using the CS5 Service Manager application (IF it is working correctly). The quickest way to tell if they are installed is probably to look in this folder: Adobe Photoshop CS5/Plug-Ins/Extensions.
    There should only be 5 there by default: Enable Async IO, FastCore, MMXCore, MultiProcessor Support, and ScriptingSupport.
    Let me know if you still have  questions,
    regards,
    steve
    Linda1234567 wrote:
    Okay, now I have no idea what you're talking about!  pattern maker is working.  Can't I just leave well enough alone?:-)Linda
    Date: Wed, 29 Dec 2010 17:37:09 -0700
    From: [email protected]
    To: [email protected]
    Subject: Photoshop Macintosh Please help me install Pattern Maker?
    Hi Linda,
    If you installed the Optional Extensions Plug-Ins.mxp you'll want to uninstall all of them (or disable them and only enable individual ones that are needed). To uninstall, use the CS5 Extension Manager. To disable them, individually rename each with a tilde(~) as the first character.
    regards,
    steve
    >

  • Need help in finding patterns and there counts

    Hi All,
    I need help in finding patterns as well as number of occurrences of those patterns in a table's column's data.
    Consider sample data - one row's column from a table:
    "S-S-S-P-S-B-S-S-C-S-P"
    My requirement is:
    I should get all the patterns that are followed by 'S'.
    Example: for the above given data the patterns and counts are
    SS - count is 3
    SP - count is 2
    SB - count is 1
    SS - count is 1
    There is one more condition for the above requirement:
    If 'S' is followed by 'A', then 'SA' should not be considered as a pattern. The pattern should stretch until a non 'A' character is found.
    Consider sample data for the above case:
    "S-S-A-S-S-A-A-C-S-P-S-A"
    for the above given data the patterns and counts are
    SS - count is 2
    SP - count is 1
    SAS - count is 1
    SAAC - count is 1
    The data column is stored as VARCHAR2 type.
    I have Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
    Thanks in advance,
    Girish G

    Hi, Girish,
    Girish G wrote:
    Hi All,
    I need help in finding patterns as well as number of occurrences of those patterns in a table's column's data.
    Consider sample data - one row's column from a table:
    "S-S-S-P-S-B-S-S-C-S-P"
    My requirement is:
    I should get all the patterns that are followed by 'S'.Do you mean "I should get all patterns that *start with* 'S'"?
    Example: for the above given data the patterns and counts are
    SS - count is 3
    SP - count is 2
    SB - count is 1
    SS - count is 1Why are there two rows of output for 'SS'? What does the second one, with count=1, mean?
    There is one more condition for the above requirement:
    If 'S' is followed by 'A', then 'SA' should not be considered as a pattern. The pattern should stretch until a non 'A' character is found.
    Consider sample data for the above case:
    "S-S-A-S-S-A-A-C-S-P-S-A"
    for the above given data the patterns and counts are
    SS - count is 2
    SP - count is 1
    SAS - count is 1
    SAAC - count is 1
    The data column is stored as VARCHAR2 type.
    I have Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit ProductionThanks; the version information is very helpful.
    Thanks in advance,
    Girish GWhenever you have a question, please post a little sample data (CREATE TABLE and INSERT statements) and the results you want from that data.
    For example, your sample data might be:
    CREATE TABLE     table_x
    (       x_id     NUMBER     PRIMARY KEY
    ,     txt     VARCHAR2 (30)
    INSERT INTO table_x (x_id, txt) VALUES (1, 'S-S-S-P-S-B-S-S-C-S-P');
    INSERT INTO table_x (x_id, txt) VALUES (2, 'S-S-A-S-S-A-A-C-S-P-S-A');and the results you want from that data might be:
    X_ID TXT                       PATTERN                          CNT
       1 S-S-S-P-S-B-S-S-C-S-P     SB                                 1
       1 S-S-S-P-S-B-S-S-C-S-P     SC                                 1
       1 S-S-S-P-S-B-S-S-C-S-P     SP                                 2
       1 S-S-S-P-S-B-S-S-C-S-P     SS                                 3
       2 S-S-A-S-S-A-A-C-S-P-S-A   SAAC                               1
       2 S-S-A-S-S-A-A-C-S-P-S-A   SAS                                1
       2 S-S-A-S-S-A-A-C-S-P-S-A   SP                                 1
       2 S-S-A-S-S-A-A-C-S-P-S-A   SS                                 2(This corresponds to what you posted, except that there is only one output row for 'SS' when x_id=1.)
    One way to get those results in Oracle 11 is:
    WITH   got_s_cnt    AS
         SELECT     x_id, txt
         ,     REGEXP_COUNT (txt, 'S')     AS s_cnt
         FROM     table_x
    ,     cntr          AS
         SELECT     LEVEL     AS n
         FROM     dual
         CONNECT BY     LEVEL <= (
                                   SELECT  MAX (s_cnt)
                             FROM    got_s_cnt
    ,     got_pattern     AS
         SELECT     s.x_id
         ,     s.txt
         ,     c.n
         ,     REGEXP_SUBSTR ( REPLACE ( SUBSTR ( txt
                                                 , INSTR (s.txt, 'S', 1, c.n)
                         , 'SA*[^A]'
                            )       AS pattern
         FROM    got_s_cnt  s
         JOIN     cntr        c  ON  c.n  <= s.s_cnt
    SELECT       x_id
    ,       txt
    ,       pattern
    ,       COUNT (*)     AS cnt
    FROM       got_pattern
    WHERE       pattern     IS NOT NULL
    GROUP BY  x_id
    ,            txt
    ,       pattern
    ORDER BY  x_id
    ,            pattern
    ;At the heart of this query is the call to REGEXP_SUBSTR:
    REGEXP_SUBSTR ( x
               , 'SA*[^A]'
               )which is looking for:
    S     = the letter S
    A*     = the letter A, repeated 0 or more times
    [^A]     = anything except the letter A

  • Help! Unwanted patterns appearing in the background of edited photos!

    Hopefully someone can shed some light on this- I'm continuing to have issues when I open a photo to edit in Elements. I will apply a filter or a distortion or even sharpen the image and then there are suddenly gray and white patterns that appear in the background of my photo. They're not pixels- it looks as though the background of the photo is showing through and it saves as a JPEG that way as well (background showing through). I've included a screenshot of a photo I was editing where it occurred.
    I've tried contacting support for this- the first time they claimed it was fixed (it wasn't) and the second time they hung up on me so I'm getting desperate to find someone with an answer here. Any help would be much appreciated- thanks!

    Update your graphics driver and flush the disk cache. This is an artifact that relates to that - eitehr the buffer reappears when you set it back to the old resolution or an invalid cache is pulled in. It only disappears when you change the resolution because naturally there is no previously stored data...
    Mylenium

  • Help on DAO pattern

    Hello!
    I'm having a problem implementing the DAO pattern.
    Suppose that I have two database tables:
    emp(id, name, sex, deptid)
    dept(id, name)
    If I follow the DAO pattern, I use two DAO interfaces, one for each
    table, and "entity". EmployeeDAO, and DepartmentDAO.
    (I'm using an abstract factory to create storage-specific DAOS)
    These DAOs return instances of Employee, and Department, or lists of them. (ValueObjects).
    This is all great and works very well, but suppose I want to produce the following
    presentation on the web:
    deptname | male | female
    Dept A   | 10   | 20
    Dept B   | 15   | 30In essense, this is a request for all the departments.
    I would iterate through this list, and want to display how many
    males, and how many females there are in each department.
    Should this be in the DepartmentDAO, or in a separate DAO?
    Or should this be put in some BusinessDelegate?
    That is, DepartmentDelegate.countMales(dept);
    Or should I put a method in the ValueObject Department that in turn uses the DAO to count males?
    Or should I load the number of females into the valueobject when fetching it from the
    database in the first place?
    Or should I construct a specialized view of the department such as:
    class StupidViewOfDepartment
       private Department dept;
       private int males;
       private int females;
       public StupidViewOfDepartment(Department dept, int males, int females){
       public int numFemales();
          return females;
       public int numMales(){
          return males;
    }...having some class return a collection of this specialized view?
    In that case, which class would that be?
    A new DAO or the DepartmentDAO?
    All classical examples of DAO patterns that I can find, fails to adress
    other issues than just retreiving a single Employee, or a list of them.
    Can someone advise me on this?

    You said:
    My problem might be, that the data I'm asking for, is not distinct objects, business objects,
    but a "new type of object" consisting of this particular information, that is
    deptname, numMales, numFemales.
    EXACTLY! You are querying for data that is either aggregate, a combination of various other business objects or a very large set of known business objects. In any of these cases, you probably don't want to use a vanilla DAO. Write a dedicated search DAO. Depending on your OO purity level and time horizon, you could make VO's for the search request or the results returned.
    You said:
    I'd like to think of this as report functionality, or aggregate reports.
    I'm good at database programming, and I'm particularly good at optimization,
    so if I cannot do this the good-looking way, I can always resort to brutal techniques...ehum
    PERFECT! If you are great at database operations, and you know exactly how you want to optimize a given search, then give it its own DAO. The main problem with the object->relational boundary is that most cookie-cutter solutions (ala entity beans with CMP) cannot even remotely appropach the optimization level of a good database programmer. If you want to optimize a search in SQL or a stored procuedure, do that. Then have a dedicated search DAO use that funcitonality. (If you want to do it "right", make a search Factory object that will return various implementations, some may be vendor-specific or optimized, others might be generic; the Factory simply returns a search DAO interface, while specific implementations can concentrate on the task at hand. Swapping implementations with the same interface should be trivial).
    - Saish
    "My karma ran over your dogma." - Anon

  • Help for image pattern matching

    Hello Everyone
    I am working for my last year project. In my project I will work on the image processing to find a moving object. I will work by JMF. I have finished to grab a frame from the webcam video clips. Now I need a algorithm to find a Image pattern from the grabed image. But I donot know which algorithm is fine for image pattern matching as well as how can I implement in java. Is anyone know please help me very urgently.
    Thank you
    Md. Mainul Hasan

    If you would like to take a look at http://www.exactfutures.com/index01.htm and http://www.exactfutures.com/index02.htm and http://www.codeproject.com/useritems/activity.asp then these pages and links may well be useful to you. It may not be exactly what you are looking for, but it does point to some examples with source for video analytics, and at the very least they illustrate how to capture & handle the data including a fast movement detection algorithm. If you want to find a specific shape then search the internet for information on chamfer distance transforms - one can use JMF or extend these simple examples to apply those techniques.

  • Help required with Pattern (Regex use)

    Hello everybody !!
    I'd like to use the Regex Package to find the following Pattern in the following expression:
    PATTERN = prim*bbb
    INPUT = xxx prim yyy xxx prim aaa bbb ddd
    and I would like to obtain two results in the same matching:
    1=> prim yyy xxx prim aaa bbb
    2=> prim aaa bbb
    When I try I obtain just the first one as you can see below:
    Current REGEX is: prim.*bbb
    Current INPUT is: xxx prim yyy xxx prim aaa bbb ddd
    Nombre de groupe =0
    I found the text "prim yyy xxx prim aaa bbb" starting at index 4 and ending at i
    ndex 29.
    Could you help me to cope with regex in order to define such Pattern and obtain these results.
    Thanks a lot !!

    Ok here is something that I wrote up.
    Keep in mind I do not have java 1.4 installed so I could not compile nor test this code.
    It seems like a crazy way to do it , but I can't think of any other way at this time.
    Basically find the String, Trim off the prim and bbb and try to find it again, repeat untill there is not a gap between prim and bbb or maybee a gap of only 1 , was not sure what your exit point would be.
    Hopefully maybee this will help , or not confuse. :-)
    while(matcher.find()) {
    String matchedString = matcher.group();
    System.out.println("I found the text \"" + matcher.group()
    + "\" starting at index " + matcher.start()
    + " and ending at index " + matcher.end() + ".");
    // call this method to search for inner matches
    findInnerMatch(matchedString);
    public void findInnerMatch(String matchedString,String regex) {
    // get the string between prim and bbb *** check index's etc...
    String innerString = matchedString.substring(matchedString.indexOf("prim"),matchedString.lastIndexOf("bbb")-1);
    // make a new pattern with same regular expression
    Pattern pattern = Pattern.compile(regex);
    // make a new matcher with the inner string portion
    Matcher matcher = pattern.matcher(innerString);
    if (matcher.find()) {
    // if it finds a match print it out
    System.out.print("Found: " + innerString);
    // see if there is a gap between prim and bbb *** check index's etc..
    while (innerString.indexOf("prim") < innerString.lastIndexOf("bbb")) {
    // if more check again another occurance
    findInnerMatch(innerString);
    }

  • Help needed with pattern matching (analytics SQL ?)

    Hello Forum Users,
    I've got a curious problem on my hands that I am unable to think of an efficient way to code in Oracle SQL ....
    (1) Background
    Two tables :
    MEASUREMENTS
    ID NUMBER
    M1 NUMBER
    M2 NUMBER
    M3 NUMBER
    M4 NUMBER
    INTERESTING_VALUES
    ID NUMBER
    M1 NUMBER
    M2 NUMBER
    M3 NUMBER
    M4 NUMBER
    (2) OUTPUT NEEDED
    For each row in "MEASUREMENTS", count the number of matches in "INTERESTING_VALUES" (all rows). Please note that the matches might not be in the same column.... e.g. for a given row MEASUREMENTS M1 might match INTERESTING_VALUES M3.
    I need to count 2,3 and 4 matches and provide the count values seperatley.
    I am not interested in fuzzy matching (e.g. "greater than" or "less than"), the numbers only need to match exactly.
    (You can use features up to 11g).
    Thank you for your help.

    yup here you go...
    SQL> select * from measurement;
            ID         M1         M2         M3         M4
             1         30         40        110        120
             2         12         24        175        192
             3         22         35        147        181
    SQL> select * from interesting;
            ID         M1         M2         M3         M4
             1         16        171         30        110
             2         40        171         30        110
             5        181        147         35         22
             4        175         12        192         24
             3        175         86        192         24
    SQL>  SELECT id,
      2    SUM(
      3    CASE
      4      WHEN LEN=1
      5      THEN 1
      6      ELSE 0
      7    END) repeat2,
      8    SUM(
      9    CASE
    10      WHEN LEN=2
    11      THEN 1
    12      ELSE 0
    13    END) repeat3,
    14    SUM(
    15    CASE
    16      WHEN LEN=3
    17      THEN 1
    18      ELSE 0
    19    END) repeat4
    20     FROM
    21    (SELECT id,
    22      spath   ,
    23      (LENGTH(spath)-LENGTH(REPLACE(LOWER(spath),',') ))/ LENGTH(',') LEN
    24       FROM
    25      (SELECT t.* ,
    26        ltrim(sys_connect_by_path(cvalue,','),',') spath
    27         FROM
    28        (SELECT p.*,
    29          row_number() over (partition BY id, id1 order by cvalue) rnum
    30           FROM
    31          (SELECT m.id,
    32            m.m1      ,
    33            m.m2      ,
    34            m.m3      ,
    35            m.m4      ,
    36            (SELECT COUNT(*)
    37               FROM interesting q
    38              WHERE q.id=I.id
    39            AND (q.m1   = column_value
    40            OR q.m2     =column_value
    41            OR q.m3     =column_value
    42            OR m4       =column_value)
    43            ) cnt              ,
    44            column_value cvalue,
    45            i.id id1           ,
    46            i.m1 m11           ,
    47            i.m2 m21           ,
    48            i.m3 m31           ,
    49            i.m4 m41
    50             FROM measurement m                   ,
    51            TABLE(sys.odcinumberlist(m1,m2,m3,m4)),
    52            interesting I
    53         ORDER BY id,
    54            id1     ,
    55            cvalue
    56          ) p
    57          WHERE cnt=1
    58        ) t
    59        WHERE level        >1
    60        CONNECT BY prior id=id
    61      AND prior id1        =id1
    62      AND prior rnum      <=rnum-1
    63        --start with rnum=1
    64     ORDER BY id,
    65        id1     ,
    66        cvalue
    67      )
    68   ORDER BY 1,2
    69    )
    70  GROUP BY id
    71  ORDER BY 1;
            ID    REPEAT2    REPEAT3    REPEAT4
             1          4          1          0
             2          9          5          1
             3          6          4          1I am posting the code without number formatting so that it gets easier for you to copy the code...
    select id,sum(case when len=1 then 1 else 0 end) repeat2,sum(case when len=2 then 1 else 0 end) repeat3,sum(case when len=3 then 1 else 0 end) repeat4 from
    (select id,spath,(LENGTH(spath)-LENGTH(REPLACE(LOWER(spath),',') ))/ LENGTH(',') len from
    (select t.*
    ,ltrim(sys_connect_by_path(cvalue,','),',') spath
    from (select p.*,row_number() over (partition by id, id1 order by cvalue) rnum from (SELECT m.id,
        m.m1      ,
        m.m2      ,
        m.m3      ,
        m.m4      ,
        (SELECT COUNT(*)
           FROM interesting q
          WHERE q.id=I.id
        AND (q.m1    = column_value
        OR q.m2     =column_value
        OR q.m3     =column_value
        OR m4       =column_value)
        ) cnt              ,
        column_value cvalue,
        i.id id1           ,
        i.m1 m11           ,
        i.m2 m21           ,
        i.m3 m31           ,
        i.m4 m41          
        FROM measurement m                     ,
        TABLE(sys.odcinumberlist(m1,m2,m3,m4)),
        interesting I
      order by id,id1,cvalue
      ) p where cnt=1
    ) t where level>1
    connect by prior id=id and prior id1=id1 and prior rnum<=rnum-1
    order by id,id1,cvalue) order by 1,2) group by id order by 1Ravi Kumar
    Edited by: ravikumar.sv on Sep 15, 2009 3:54 PM

  • New -- Help me add pattern files

    Hello -- I'm fairly new to Photoshop. I want to add one of the pattern libraries I see in the exchange. I have downloaded the .pat file -- I put it in the adobe//preset//patterns folder, then closed and opened photoshop -- no good. I saved the file elsewhere, went to "load pattern" in PHotoshop, selected it, restarted photoshop -- still no good.
    How do I add these external pattern files?

    Since you placed the .pat file in the patterns folder,its' name should be in the list of patterns below "replace patterns..." in the patterns menu after you restart Photoshop. You select your new pattern from that list.

  • Help Print ASCII Pattern

    Hey I'm writing a simple little program that creates a method call printPatterns() that when called should print out two simple patterns:
    #However, I'm not exactly sure how to call it in the main method. Here's the code thus far:
    import java.io.*;
    import java.util.Scanner;
    import java.lang.String.*;
    public class Patterns {
        public void printPatterns()
        int row=1, j=1;
        char OUTPUT='#';
        System.out.println();
        for (row = 1; row <= 8; row++)
            for (j = 1; j <= row - 1; j++)
                System.out.print(" ");
            for (j = 1; j <= 9 - row; j++)
                System.out.print(OUTPUT);
        System.out.println();
        System.out.println();
        for (row = 1; row <= 8; row++)
            for (j = 1; j <= 9 - row; j++)
                System.out.print(OUTPUT);
        System.out.println();
        System.out.println();
        public void main (String[] args)
            printPatterns test = new printPatterns();
            System.out.print(test);
    }

    Simply create an object and call its methods.
    public class Fubar
        public void foo()
            System.out.println("Foo");
        public static void main(String[] args)
            Fubar myFubar = new Fubar();  // create an object myFubar
            myFubar.foo();                // and call its method foo
    }edit: is this spooky or what??? I created my Fubar / foo before I saw the previous post.
    Edited by: Encephalopathic on Mar 26, 2008 8:05 PM

  • Help with this pattern

    hello experts;
    I have the following sample query below.
    with data as (select 'NWC text me' as word, 1 as id from dual
                    union all
                  select 'Zone out' as word, 2 as id from dual
                  union all
                  select 'pj NWC' as word, 3 as id from dual
                  union all
                  select 'jknwc place' as word, 4 as id from dual
                  union all
                  select 'jkndcNWC' as word, 5 as id from dual
              select * from data
    I would like the following results
    word                       New_word           Id
    NWC text me          text me               1
    Zone out                 Zone out              2
    pj NWC                  pj                        3
    jknwc place            jknwc place          4
    jkndcNWC             jkndcNWC            5
    The result is gotten from the fact NWC is usually removed from the beginning of the word if it is a standalone and the end of the word if it is standalone. All help is appreciated.
    thank you

    I know this trend has been answered but i tried to modified chris solutions to include this new condition that came up but i am not able to it. it is id 7 and it is for situation that contains "ON NWC OF" where "ON NWC OF" is stripped off as well.
    with data as (select 'NWC text me' as word, 1 as id from dual
                    union all
                  select 'Zone out' as word, 2 as id from dual
                  union all
                  select 'pj NWC' as word, 3 as id from dual
                  union all
                  select 'jknwc place' as word, 4 as id from dual
                  union all
                  select 'jkndcNWC' as word, 5 as id from dual
                union all
                  select 'NWC OF mmmo' as word, 6 as id from dual
                union all
                select 'ON NWC OF ttt' as word, 7 as id from dual
              select * from data
    expected results
    word        
    New_word      
    Id
    NWC text me 
    text me        
    1
    Zone out    
    Zone out       
    2
    pj NWC      
    pj             
    3
    jknwc place 
    jknwc place    
    4
    jkndcNWC    
    jkndcNWC       
    5
    NWC OF mmmo 
    mmmo           
    6
    ON NWC OF ttt
    ttt            
    7

  • Help constructing SOM Expression

    Hi,
    I've puzzled over this for many hours and decided I definitely am a fish out of whater. Could you please help?
    My problem: I need a way to substitue a string for the SOM Expression of certain fields without always having to write out the whole expression. Basically, I am trying to figure out if I know the location, can I pass a variable with that location's string into a function, and then have the function process several instructions, using the passed string as the SOM Expression?
    For example, if the SOM Expression for 2 fields are:
    Form1.Subform1.FieldA
    Form1.Subform2.FieldB
    If I know the string which is the exact location of FieldA and FieldB, can I somehow pass those strings into a script object so the same function can work with multiple fields. E.g. if I wanted to change the font size, bold the font, and font color of each field, could I pass the string of the SOM Expression into a script object method which would process these 3 properties, and then pass the string for the second field's location into the same function to process that field? The reason I want to do this is my form has about 50 such fields which have about 15 processes which are used for each form.
    I'm sorry if this isn't clear. I'd really appreciate any help someone might have to offer.
    Thanks,
    Jeff

    You can pass the object itself by using the somExpression. You do not need to pass a string in. So calling the script would be:
    ScriptObject.FunctionName(Form1.Subform1.FieldA)
    and in ths script object to recieve the object you would use:
    var myObj = Form1.Subform1.FieldA.nodes
    Or you can pass subform nodes and search the subform for fields. if you post your email I will send you a sample that shows how.

  • Help with regex pattern matching.

    Hi everyone
    I am trying to write a regex that will extract each of the links from a piece of HTML code. The sample piece of HTML is as follows:
    <td class="content" valign="top">
         <!-- BODY CONTENT -->
    <script language="JavaScript"
    src="http://chat.livechatinc.net/licence/1023687/script.cgi?lang=en&groups=0"></script>
    <a href="makeReservation.html">Making a reservation</a><br/>
    <a href="changeAccount.html">Changing my account</a><br/>
    <a href="viewBooking.html">Viewing my bookings</a><br/>I am interested in extracting each link and the corrresponding text for that link into groups.
    So far I have the following regex <td class="content" valign="top">.*?<a href="(.*?)">(.*?)</a><br>However this regex only matches the first line in the block of links, but I need to match each line in the block of links.
    Any ideas? Any suggestions are appeciated as always.
    Thanks.

    Hi sabre,
    thanks for the reply.
    I am already using a while loop with matcher.find(), but it still only returns the first link based on my regex.
    the code is as follows.
    private static final Pattern MENU_ITEM_PATTERN = compilePattern("<td class=\"content\" valign=\"top\">.*?<a href=\"(.*?)\">(.*?)</a><br>");
    private LinkedHashMap<String,String> findHelpLinks(String body) {
        LinkedHashMap<String, String> helpLinks = new LinkedHashMap<String,String>();
        String link;
        String linkText;
          Matcher matcher = MENU_ITEM_PATTERN.matcher(body);
          while(matcher.find()){
            link = matcher.group(1);
            linkText = matcher.group(2);
            if(link != null && linkText != null){
              helpLinks.put(link,linkText);
        return helpLinks;
    private static Pattern compilePattern(String pattern) {
        return Pattern.compile(pattern, Pattern.DOTALL + Pattern.MULTILINE
            + Pattern.CASE_INSENSITIVE);
      }Any ideas?

  • Need help with aligning patterns

    I’m having trouble aligning a pattern, and I think I’m missing some basic concept.  I want to align a pattern to start at a particular point, but AI always seems to align it to the top left corner of the (page/artboard). I remember having this trouble in CS3, but I thought the problem had been addressed in CS5.
    My pattern is 1 sqin., and I want to create a strip starting 1/2 in from the top and 1/2 in from the left hand edge of a page.  According to the CS5 manual: “To adjust where all patterns in your artwork begin tiling, you can change the file’s ruler origin.” So I change the origin to (0.5in x, 0.5in y). But when I apply my pattern, it still aligns to the (0.0) origin.
    For example, if this is the original pattern:
    when I apply it to an area using (0.5, 0.5) as the origin, it gets applied like this:
    I’ve looked through my preferences and the only thing I found that might affect this was the “Transform Pattern Tiles” parameter, but changing this didn’t have any effect.
    What am I doing wrong? I can work around the problem in a couple of ways, but I don't want to go through extra steps if I don't have to.

    I’m having trouble aligning a pattern, and I think I’m missing some basic concept.  I want to align a pattern to start at a particular point, but AI always seems to align it to the top left corner of the (page/artboard). I remember having this trouble in CS3, but I thought the problem had been addressed in CS5.
    My pattern is 1 sqin., and I want to create a strip starting 1/2 in from the top and 1/2 in from the left hand edge of a page.  According to the CS5 manual: “To adjust where all patterns in your artwork begin tiling, you can change the file’s ruler origin.” So I change the origin to (0.5in x, 0.5in y). But when I apply my pattern, it still aligns to the (0.0) origin.
    For example, if this is the original pattern:
    when I apply it to an area using (0.5, 0.5) as the origin, it gets applied like this:
    I’ve looked through my preferences and the only thing I found that might affect this was the “Transform Pattern Tiles” parameter, but changing this didn’t have any effect.
    What am I doing wrong? I can work around the problem in a couple of ways, but I don't want to go through extra steps if I don't have to.

  • Help Please - CS4 Pattern Fills location

    I am using CS4. I use a desktop and a laptop in the Windows Operating system.
    I created some background pattern fills working on my desktop and would like to copy them to my laptop. I looked in the program files (via Explore) but could not find where they reside.
    Thanks in advance for pointing me to them.

    Thanks for responding.
    If I have already save them as a pattern and they appear in the drop down FILL selection can I export them or must it all be done in one swoop?
    If I EXPORT them to a file and want to bring into my laptop files, do I Import them or just drag and drop into a folder? Or just open them and Edit>Define again?
    If I export them must they be a particular file format?
    Thanks again.

Maybe you are looking for