Using regular expressions to store the first 3 letters of a string

Can anyone help with regular expressions?

The problem:

I have a contact field which is holder of a value of campaign here is an example of how we look at:

EMC | TEACHER | HRSUB | June2012-may-01

I need to store the first three letters of the code in another field of contact, the first three letters are not a defined value and may change in different codes.


I have next to no experience with regular expressions, so I am struggling to set up cloud connector Eloqua - here's a screenshot:

A few tips on how to set up?

This should do the trick, although I would recommend that make you a few tests more using http://regexpal.com/

^|\| (.*)$

Chris

Tags: Marketers

Similar Questions

  • Find the words (wild cards) using regular expressions

    I'm testing to see if the words are present for revision 1 of a drawing of the cartridge.

    The script search the digit 1 followed by a date, a title, and 4 sets of initials.

    The number 1 is static, (date, title and original are the cards that they are different for each design).

    I use regular expressions to match the words.

    The regular expression highlighted in blue is the number 1 and the date.

    Him remains highlighted in orange does not match the title and initials.

    If anyone can help with the regular expression that is most appreciated.

    Once I got that work will add the form fields for the initials, noting only the console at this point for the tests.

    numWords = this.getPageNumWords (0);

    number of words on the page

    loop through the words on the page

    for (var j = 0; j < numWords-1; j ++)

    {/ / get the pair of words to test}

    ckWords = this.getPageNthWord (0, j) + ' ' + this.getPageNthWord (0, j + 1); test words

    Check if 1 26.05.16 THE STRENGTHENING REVISED MM SB AE GM word string is present

    If (ckWords.match(/ ^ 1\s [0-9] {1,2}.)) [0-9] {1,2}. [0-9] {2} \s\w+(\s+\w+){1,7}/))

    {

    Console.println (ckWords);

    }

    }

    You can use something like this:

    ckWords = this.getPageNthWord (0, j) + ' ' + this.getPageNthWord (j, 0, + 1) + ' ' + this.getPageNthWord (0, + 2 j) + ' ' + this.getPageNthWord (0, j + 3) + ' ' + this.getPageNthWord (0, j + 4) + ' ' + this.getPageNthWord (0, j + 5) + ' ' + this.getPageNthWord (0, j + 6);

    If (! ckWords.match (/ ^ 1\s\d {1,2} \.\d {1,2} \.\d {2} \s\w+ (?:-s + \w +) {1.8} \s([A-Z]{2})\s([A-Z]{2})-s ([A - Z] {2}) \s([A-Z]{2})$ /)) ckWords + ckWords + "" + this.getPageNthWord (0, j + 7);

    If (! ckWords.match (/ ^ 1\s\d {1,2} \.\d {1,2} \.\d {2} \s\w+ (?:-s + \w +) {1.8} \s([A-Z]{2})\s([A-Z]{2})-s ([A - Z] {2}) \s([A-Z]{2})$ /)) ckWords + ckWords + "" + this.getPageNthWord (0, j + 8);

    If (ckWords.match (/ ^ 1\s\d {1,2} \.\d {1,2} {2} \s\w+ \.\d (?:-s + \w +) 1.8 ([A - Z] {2}) \s([A-Z]{2})\s([A-Z]{2})\s {} \s([A-Z]{2})$ /))

    {

    ...

  • Using Regular Expressions in the Code of edge

    Hello.

    I am quite new to the Edge Code but find it quite interesting to use.

    The find/replace feature is pretty but I got a little confused on how to use regular expression matching.

    I tried to clean up the coordinates of a file Adobe Edge animate full of 120.17px (heavy and less accurate)

    So basically you're looking \d+\.\d+px

    First of all, she says "use /re/ for regex" even though I know the Code is made for developers who * courses * know that it took me a little time to understand I should just put my regex between slashes.

    /\d+\.\d+PX/

    then the time comes to replace them. ALT-cmd-F and it says "replace".

    Puzzled again.

    Will I type my full sentence there? Maybe a «...» "written up somewhere around would avoid this question because, there, of course, a second field to come.

    And there, I got stuck.

    I can not find how to get the replacement of the model.

    tried to \1 $1 \1/ $1 / nothing seems to work... any hint of welcome.

    Franck,

    You are right that it does not work. I open a topic. Here is the link if you want to follow: https://github.com/adobe/brackets/issues/1861

    FYI, I know exactly how you want to replace the search results, but here are a few tips:

    You must set the text that you want to retrieve by using parentheses. Thus, for example, if you want the integer part of the number of the result, then your regexp would be: / (\d+)\.\d+px/

    Then you must specify the first result using $1, so (when it's fixed), you can use something like: $1px

    Thank you

    Randy

  • Use regular expressions to extract .llb file from the path name

    I'm trying to be smart (always a dangerous thing) and use a regular expression to extract the name of a library to a filepath converted to a string.   While I appreciate there are other ways to do this, regex seems to be a very powerful way of neat, I would be able to operate.

    IE, if I have a string of type, C:\applications\versions\library.llb\toplevel.vi, I want to be able to extract the library.llb of the string, because it will be of variable length, may include the numbers & spaces and may be located in a file of variable depth hierarchy.   In other words, I want to extract the part of the string between the last-which ends with .llb

    The best I managed so far is \\+.*llb who all returned less the drive letter and the toplevel.vi

    Can someone help me to achieve this goal, or I'm better by using an alternative method (for example filepath string in array, search for .llb)

    Thank you

    Matt

    Hi Matt,

    attached you will find two other options.

    Mike

  • How to extract the value of a tag XML using regular Expressions

    We get a response XML from a WEB SERVICE.

    I convert it to VARCHAR2.

    Now, I want to get the real answer that is inside the tag of the response.

    I tried this:

    DECLARE

    V_1 VARCHAR2 (30000): = ' < soap: Body > < ns:ProcessArgusFeedsResponse xmlns:ns = "urn: PegaRULES:SOAP:ArgusToPegaFeeds:Services" > ' |

    '< response > good < / answer >< / ns:ProcessArgusFeedsResponse > < / soap: Body > ';

    v_response VARCHAR2 (100);

    BEGIN

    DBMS_OUTPUT. PUT_LINE (V_1);

    v_response: = REGEXP_SUBSTR (v_1, ' / < >(.+?) < \/Response > answer /');

    dbms_output.put_line (v_response);

    END;

    It does not work.

    Any help would be greatly appreicated.

    Hello

    user12240205 wrote:

    We get a response XML from a WEB SERVICE.

    I convert it to VARCHAR2.

    Why?  XML has its own native ways of analysis; Why not use them?

    If you use regular expressions, then REGEXP_REPLACE, as shown above, is a good option in Oracle 10, but starting in Oracle 11.1, you can use REGEXP_SUBSTR like this:

    REGEXP_SUBSTR (v_1

    , '(.+?)'

    1

    1

    NULL

    1

    )

    The 6th argument is like a backreference; "He tells REGEXP_SUBSTR did not return to the entire organization, but only the part inside the 1st left '(' et correspondant à sa droite).

    The '?' to make it non-greedy is necessary only if v_1 can contain more than one response.

    Now, I want to get the real answer that is inside the tag of the response.

    I tried this:

    DECLARE

    V_1 VARCHAR2 (30000): = "" |

    'Good';

    v_response VARCHAR2 (100);

    BEGIN

    DBMS_OUTPUT. PUT_LINE (V_1);

    v_response: = REGEXP_SUBSTR (v_1, ' /(. +?)) <\ esponse="">/');

    dbms_output.put_line (v_response);

    END;

    It does not work.

    That's because it's looking for a slash ("/") before the '' tag and another after the ' tag.

    The backslash ("\") is not necessary here, but it is not nothing wrong.

  • One for the era: how to get this output using REGULAR EXPRESSIONS?

    How to get the bottom of output using REGULAR EXPRESSIONS?
    SQL> ed
    Wrote file afiedt.buf
    
      1* CREATE TABLE cus___addresses    (full_address                   VARCHAR2(200 BYTE))
    SQL> /
    
    Table created.
    
    SQL> PROMPT Address Format is: House #/Housename,  street,  City, Zip Code, COUNTRY
    House #/Housename,  street,  City, Zip Code, COUNTRY
    SQL> INSERT INTO cus___addresses VALUES('1, 3rd street, Lansing, MI 49001, USA');
    
    1 row created.
    
    SQL> INSERT INTO cus___addresses VALUES('3B, fifth street, Clinton, OK 74103, USA');
    
    1 row created.
    
    SQL> INSERT INTO cus___addresses VALUES('Rose Villa, Stanton Grove, Murray, TN 37183, USA');
    
    1 row created.
    
    SQL> SELECT * FROM cus___addresses;
    
    FULL_ADDRESS
    ----------------------------------------------------------------------------------------------------
    1, 3rd street, Lansing, MI 49001, USA
    3B, fifth street, Clinton, OK 74103, USA
    Rose Villa, Stanton Grove, Murray, TN 37183, USA
    
    SQL> The REG EXP query shouLd output the ZIP codes: i.e. 49001, 74103, 37183 in 3 rows.
    Published by: user12240205 on June 18, 2012 03:19
    /* Formatted on 2012/06/18 17:25 (Formatter Plus v4.8.8) */
    SELECT REGEXP_SUBSTR ((REGEXP_SUBSTR (full_address, '[^,]+', 1, 4)), '[[:digit:]]+') RESULT
      FROM cus___addresses
    
  • Changeparticular the characters of a string using regular expressions...

    Hi all
    I'm writing a function using the function of expression regular oracles REGEXP_REPLACE but I could not succeed until now.

    My problem is as follows, I have a text in a column say "Scott Sdfdfs Sdfd" I want to replace all the s and S with X characters and make the text looks like "XdfXdf XdfdfX Xdfd".

    It is possible by using regular expressions in oracle?
    Can you give me some clue?

    Thank you
    select
      regexp_replace('sdfsdf Sdfdfs Sdfd',
                     's|S', 'X') Replaced
    from dual;
    
    REPLACED
    ------------------
    XdfXdf XdfdfX Xdfd 
    
  • How can I use a regular expression to validate the email address

    How can I use a regular expression to validate the e-mail address.

    var emailExp:RegExp = /([a-z0-9._-]+?) @([a-z0-9.-] +). ([a - z] {2,4});

  • Regular expression to remove the space in the HTML tag

    Hi all

    My HTML string is as below.

    Select ' < CityName > RICHMOND < / Nom_ville >< StateCd > ABCD CDE< StateCd / >< CtryCd > CAN < / CtryCd >< CtrySubDivCd > BC < / CtrySubDivCd > ' double Str

    Output desired is

    < CityName > RICHMOND < / Nom_ville > < StateCd > ABCD CDE< StateCd / > < CtryCd > CAN < / CtryCd > < CtrySubDivCd > BC < / CtrySubDivCd >

    I want to remove these spaces of the tag value box with only spaces otherwise leave it as what. Please help to implement the same using regular expressions.

    Hello

    We don't know what you want.  This site seems to be formatting your message in a weird way.

    As the statement

    SELECT «...» "THE DOUBLE;

    without formatting, to show your entry and after the exact output desired friom as, with as little in shape as possible.  It might be useful if you use some character like ~ instead of spaces (just for viewing; we will find a solution that works for spaces).

    To remove the text which consists of spaces and nothing else between the tags, you can say

    REGEXP_REPLACE (str

    , '> +<>

    , '><>

    )

    How is this string generated?  Maybe there is an easier and more effective way to keep the bad wrtings sub off the chain in the first place.

  • regular expression to remove the zeros on the right

    I need a regular expression to remove the zeros after the decimal point. I tried (?.)<=\.\d+?)0+(?=\D|$) but="" i="" get="" a="" error="" about="" look="" behind="" not="" a="" fixed="" length="" or="" something="" like="" that.="" i="" am="" not="" a="" regex="" expert="" and="" i="" was="" wondering="" just="" how="" to="" do="" this="" with="" regular="" expression="" or="" some="" other="">

    Z.K. wrote:

    [...] or some other way.

    I tried and I tried but I couldn't crack with a regular expression, so I took the easy way.  The first match found pattern the comma and the other removes the zeros to the right of the rest.  It is not discriminate between numbers and all the rest, though.

  • Chips with 3 delimiter characters using regular expressions

    Hello world

    I have a function that is able to mark the input in a collection string using regular expressions.

    In case the input string is a character such as the comma or semicolon delimiter,

    We can just get the result we want like the example below.

    SQL> select * from v$version;
    
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    

    SQL> with tab1 as (
      2      select 'abc,dfg,h,,1234' as col1 from dual
      3  )
      4  select regexp_substr(col1, '([^,]*)(,|$)', 1, level, 'i', 1) as result
      5  from tab1
      6  connect by level <= regexp_count(col1, ',')+1;
    
    
    RESULT
    ---------------
    abc
    dfg
    h
    
    1234
    

    But in the case where the channel of entry has 2 types of delimiter and each delimiter consists of 3 characters as below

    I wonder if it is possible to get the result as below.

    The input string: 01| ^ | ABCD| ^ | 111| * | 02| ^ | efgh| ^ | 222

    Separators: | * | is divided into lines, | ^ | is divided into columns

    Expected result:

    col1 col2 col3

    Row1 - > 01 abcd 111

    row2-> efgh 02 222

    Simply put, take a next

    The input string: 01| ^ | ABCD |^| 111 |*| 02 |^| efgh |^| 222

    Separator: | * |

    Result:

    01. ^ | ABCD | ^ | 111

    02. ^ | efgh | ^ | 222

    How can I achieve this using regular expressions?

    Kind regards

    Euntaek

    You need to know the number of the column from the outset:

    with tab1 as)

    Select ' 01 | ^ | ABCD | ^ | 111. * | 02. ^ | efgh | ^ | 222' as double col1

    )

    Select rownum,

    regexp_substr (regexp_substr (col1 '(.*?) ((\|\*\|)| $) ', 1, level, null, 1),'(.*?) ((\|\^\|)| $) ', 1, 1, null, 1) col1,.

    regexp_substr (regexp_substr (col1 '(.*?) ((\|\*\|)| $) ', 1, level, null, 1),'(.*?) ((\|\^\|)| $) ', 1, 2, null, 1) col2.

    regexp_substr (regexp_substr (col1 '(.*?) ((\|\*\|)| $) ', 1, level, null, 1),'(.*?) ((\|\^\|)| $) ', 1, 3, null, 1) col3

    of tab1

    connect by level<= regexp_count(col1,'\|\*\|')="" +="">

    /

    ROWNUM COL1 COL2 COL3

    ---------- ----- ----- -----

    1 01 abcd 111

    2 efgh 02 222

    SQL >

    SY.

  • A special character validation using regular expressions in ADF

    Hi guys,.

    I want to put the validation of a special as character (,.') ((en) &, -) using regular expressions.

    I asked the posting as [a-zA-Z0-9'(.),--/ &] but it does not work properly.

    Special characters should be like:

    Comma,

    Hyfan-

    Dot.

    Open and close braces (and).

    Ampercent &

    Apastrophy '

    Space ""

    Please help if anyone has idea.

    And I also tried to put under expression as...

    [a-zA-Z] + (\\s* [0-9] * [a-zA-Z] *-* & * \\(*\\) *, *'*. *) * [a-zA-Z0-9] + but we need the validation if we put special characters between the charater as "ab," chain "& (bc).

    his does not work if I put a special character at the beginning and the end of the string in the ADF

    Thanks Timo...

    its working fine...

  • String format using regular expressions

    Input string output format...
    
    SELECT q'<select ab_c "ABC", efg "EFG" from dual>' str FROM DUAL
    
    Output:
    
    STR                                  
    -------------------------------------
    select ab_c "ABC", efg "EFG" from dual
    
    
    Required output format using regular expression...
    
    
    STR                                  
    -------------------------------------
    select 'ab_c' "ABC", 'efg' "EFG" from dual

    Regular expressions have many limitations as tools of analysis, and you specify the rules you want. This expression puts quotation marks around a non-empty string before a quoted string:

    SELECT regexp_replace(q'