Regular expressions in Format Definition add-on

Hello experts,
I have a question about regular expressions. I am a newbie in regular expressions and I could use some help on this one. I tried some 6 hours, but I can't get solve it myself.
Summary of my problem:
In SAP Business One (patch level 42) it is possible to use bank statement processing. A file (full of regular expressions) is to be selected, so it can match certain criteria to the bank statement file. The bank statement file consists of a certain pattern (look at the attached code snippet).
:61:071222D208,00N026
:86:P  12345678BELASTINGDIENST       F8R03782497                $GH
$0000009                         BETALINGSKENM. 123456789123456
0 1234567891234560                                            
:61:071225C758,70N078
:86:0116664495 REGULA B.V. HELPMESTRAAT 243 B 5371 AM HARDCITY HARD
CITY 48772-54314                                                  
:61:071225C425,05N078
:86:0329883585 J. MANSSHOT PATTRIOTISLAND 38 1996 PT HELMEN BIJBETA
LING VOOR RELOOP RMP1 SET ORDERNR* 69866 / SPOEDIG LEVEREN    
:61:071225C850,00N078
:86:0105327212 POSE TELEFOONSTRAAT 43 6448 SL S-ROTTERDAM MIJN OR
DERNR. 53846 REF. MAIL 21-02
- I am in search of the right type of regular expression that is used by the Format Definition add-on (javascript, .NET, perl, JAVA, python, etc.)
Besides that I need the regular expressions below, so the Format Definition will match the right lines from my bankfile.
- a regular expression that selects lines starting with :61: and line :86: including next lines (if available), so in fact it has to select everything from :86: till :61: again.
- a regular expression that selects the bank account number (position 5-14) from lines starting with :86:
- a regular expression that selects all other info from lines starting with :86: (and following if any), so all positions that follow after the bank account number
I am looking forward to the right solutions, I can give more info if you need any.

Hello Hendri,
Q1:I am in search of the right type of regular expression that is used by the Format Definition add-on (javascript, .NET, perl, JAVA, pythonetc.)
Answer: Format Definition uses .Net regular expression.
You may refer the following examples. If necessary, I can send you a guide about how to use regular expression in Format Defnition. Thanks.
Example 6
Description:
To match a field with an optional field in front. For example, u201C:61:0711211121C216,08N051NONREFu201D or u201C:61:071121C216,08N051NONREFu201D, which comprises of a record identification u201C:61:u201D, a date in the form of YYMMDD, anther optional date MMDD, one or two characters to signify the direction of money flow, a numeric amount value and some other information. The target to be matched is the numeric amount value.
Regular expression:
(?<=:61:\d(\d)?[a-zA-Z]{1,2})((\d(,\d*)?)|(,\d))
Text:
:61:0711211121C216,08N051NONREF
Matches:
1
Tips:
1.     All the fields in front of the target field are described in the look behind assertion embraced by (?<= and ). Especially, the optional field is embraced by parentheses and then a u201C?u201D  (question mark). The sub expression for amount is copied from example 1. You can compose your own regular expression for such cases in the form of (?<=REGEX_FOR_FIELDS_IN_FRONT)(REGEX_FOR_TARGET_FIELD), in which REGEX_FOR_FIELDS_IN_FRONT and REGEX_FOR_TARGET_FIELD are respectively the regular expression for the fields in front and the target field. Keep the parentheses therein.
Example 7
Description:
Find all numbers in the free text description, which are possibly document identifications, e.g. for invoices
Regular expression:
(?<=\b)(?<!\.)\d+(?=\b)(?!\.)
Text:
:86:GIRO  6890316
ENERGETICA NATURA BENELU
AFRIKAWEG 14
HULST
3187-A1176
TRANSACTIEDATUM* 03-07-2007
Matches:
6
Tips:
1.     The regular expression given finds all digits between word boundaries except those with a prior dot or following dot; u201C.u201D (dot) is escaped as \.
2.     It may find out some inaccurate matches, like the date in text. If you want to exclude u201C-u201D (hyphen) as prior or following character, resemble the case for u201C.u201D (dot), the regular expression becomes (?<=\b)(?<!\.)(?<!-)\d+(?=\b)(?!\.)(?!-). The matches will be:
:86:GIRO  6890316
ENERGETICA NATURA BENELU
AFRIKAWEG 14
HULST
3187-A1176
TRANSACTIEDATUM* 03-07-2007
You may lose some real values like u201C3187u201D before the u201C-u201D.
Example 8
Description:
Find BP account number in 9 digits with a prior u201CPu201D or u201C0u201D in the first position of free text description
Regular expression:
(?<=^(P|0))\d
Text:
0000006681 FORTIS ASR BETALINGSCENTRUM BV
Matches:
1
Tips:
1.     Use positive look behind assertion (?<=PRIOR_KEYWORD) to express the prior keyword.
2.     u201C^u201D stands for that match starts from the beginning of the text. If the text includes the record identification, you may include it also in the look behind assertion. For example,
:86:0000006681 FORTIS ASR BETALINGSCENTRUM BV
The regular expression becomes
(?<=:86:(P|0))\d
Example 9
Description:
Following example 8, to find the possible BP name after BP account number, which is composed of letter, dot or space.
Regular expression:
(?<=^(P|0)\d)[a-zA-Z. ]*
Text:
0000006681 FORTIS ASR BETALINGSCENTRUM BV
Matches:
1
Tips:
1.     In this case, put BP account number regular expression into the look behind assertion.
Example 10
Description:
Find the possible document identifications in a sub-record of :86: record. Sub-record is like u201C?00u201D, u201C?10u201D etc.  A possible document identification sub-record is made up of the following parts:
u2022     keyword u201CREu201D, u201CRGu201D, u201CRu201D, u201CINVu201D, u201CNRu201D, u201CNOu201D, u201CRECHNu201D or u201CRECHNUNGu201D, and
u2022     an optional group made up of following:
     a separator of either a dot, hyphen or slash, and
     an optional space, and
     an optional string starting with keyword u201CNRu201D or u201CNOu201D followed by a separator of either a dot, hyphen or slash, and
     an optional space
u2022     and finally document identification in digits
Regular expression:
(?<=\?\d(RE|RG|R|INV|NR|NO|RECHN|RECHNUNG)((\.|-|/)\s?((NR|NO)(\.|-|/))?\s?)?)\d+
Kind Regards
-Yatsea

Similar Messages

  • Regular expression or format into string (nevermind)

    Solved it,
    I can use string to fractional number!
    Hi,
    I have a 2D string array from a multicolumn list box, and i want to check if every value is valid number, the numbers can be a single and can have negative values. Does anyone knows which regular expression i need to check this, or is there an ever better way doing it?
    Best regards,
    Thijs
    Solved!
    Go to Solution.

    You shoudl post your solution so others who have a similar issue can learn from how you solved it.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Payment Wizard Results.rpt within EFM Format Definition add-on

    Does anyone know if there is a way of getting to the 'payment wizard results' crystal report that is imported into the 'Bank Payment file format'?
    I would like to do the following:
    1. Update the information with results from one of my payment wizard runs.
    2. Add more fields to map to a target node i.e 'Block' field from the BP addresses or a UDF
    thank you
    Nicola

    This may be a bit late, but if you right click on the report name in the EFM format explorer section, you can choose Save As...

  • EFM Format Definition ADD on

    Hi all
    I am try to use Bank Statement processing by using EFM Add on, but i am struck on point one.
    In house of bank setup assign  import name is done then in file format setup--> Right click --> Assign format project ,In this which format is need to assign.
    Also find the screen shot.
    Please help me .
    Regards,
    Shekhar

    Hi Shekhar,
    Could you advise your SAP Business One version? With releases before 8.82, you'll need an additional add-on BTHF.
    This "Assign" action doesn't convert your bank statements; it's just a preparatory step.
    Please check
    1. http://help.sap.com/saphelp_sbo900/helpdata/en/3a/8588888fda4243bb0308651153f62b/frameset.htm
    2. Its related topics.
    Regards

  • Format Definition

    Hello Experts,
    I dont know about Format Definition Add-on that what is the exactly use of this.
    why use this add-on  And what is the functionality ?
    Thanks & Regards
    M.S.Niranjan

    Hi Manvendra,
    Once you have bank statement processing installed you can import bank statements. If the format that your bank is using is not included in the standard SAP offerings you can use the FD add-on to create your own plug-ins.
    At this time FD is only to design bank statement formats.
    Please see the available documentation in the [DRC|https://service.sap.com/smb/sbo/documentation].
    All the best,
    Kerstin

  • Xml regular expressions

    Hi Friends,
    I am very new to xml technologies.i want to generate regular expression in xml.
    Like this
    if((cond1 && cond2)or(con1 || con2)...........(ConN && ConM))
    the above regular expression i need to add in xml file.
    Please help me to do this.Friends this is little bit urgent.pls help me friends.
    Thanks in advance .your help will be really appriciate.
    Awaiting for replay.
    Regards,
    Sai srinu.

    You want to add these conditions in XMLP ?
    or XML file ?

  • How can I add Regular Expression verify?

    I need to write a Regular Expression for date whose format is 'yyyy-mm-dd'('2004-5-3' or '2004-05-03') and a Regular Expression for phone number whoes format is '12345678' or '1234567' or '13809441234'.
    Thanks for any help.

    The date format is a little tricky as there are many invalid combinations. You'd be better off calling TO_DATE with your user input and format mask. If an error is returned, the date is invalid.
    For the phone number assuming a valid phone number could be 7, 8, or 11 digits (it's a little difficult to tell what the format your suggest is) then you could apply something like the following:
    ^[0-9]{7}([0-9]|[0-9]{4})?$
    Regards.

  • Format string using Regular Expression

    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 parsing tools, and you didn't specify the rules you wanted. This expression puts quotes around the non blank string before a quoted string:
    SELECT regexp_replace(q'<select ab_c "ABC", efg "EFG" from dual>',
                          '([^" ]+)( +"[^ ]*")' , '''\1''\2' ) str FROM DUAL;
    STR
    select 'ab_c' "ABC", 'efg' "EFG" from dual
    {code}
    It is not robust - a missing " will confuse it, and you should be using bind variables anyway.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Find text using regular expression and add highlight annotation

    Hi Friends
                       Is it possible to find text using regular expression and add highlight annotation using plugin

    A plugin can use the PDWordFinder to get a list of the words on a page, and their location. That's all that the API offers for searching. Of course, you can use a regular expression library to work with that word list.

  • Regular expression to add undesrcore before single capital

    I am trying to convert the names of attributes that use capitalization sort of like camelcase to distinguish multiple words, e.g. VehicleColor to use underscores instead, eg. Vehicle_Color.
    I have a regular expression that does this, however I have a problem when an abbreviation consisting of multiple upper case characters is present, e.g. AverageMPG becomes Average_M_P_G. I am trying to come up with a pattern that only adds the underscores to the first occurrence of a capital letter in a series which should result in the abbreviation MPG becoming Average_MPG.
    SQL> select * from v$version where rownum = 1;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    SQL> with test_data as
      2      (
      3      select 'VehicleColor' str from dual union all
      4      select 'WeightClass' str from dual union all
      5      select 'AverageMPG' str from dual union all
      6      select 'HighMPG' str from dual union all
      7      select 'LowMPG' str from dual union all
      8      select 'ABS_System' str from dual
      9      )
    10  select
    11      str,
    12      regexp_replace(str, '([A-Z])', '_\1', 2) result
    13  from
    14      test_data;
    STR          RESULT
    VehicleColor Vehicle_Color
    WeightClass  Weight_Class
    AverageMPG   Average_M_P_G
    HighMPG      High_M_P_G
    LowMPG       Low_M_P_G
    ABS_System   A_B_S__System
    6 rows selected.
    SQL>These are the results I would like, but I don't know how to modify the pattern to only have the replace act on the first capital letter in a series of capitals or if it is possible.
    STR          RESULT
    VehicleColor Vehicle_Color
    WeightClass  Weight_Class
    AverageMPG   Average_MPG
    HighMPG      High_MPG
    LowMPG       Low_MPG
    ABS_System   ABS_System 

    with test_data as
            select 'VehicleColor' str from dual union /**/all
            select 'WeightClass' str from dual union /**/all
            select 'AverageMPG' str from dual union/**/ all
            select 'HighMPG' str from dual union/**/ all
           select 'LowMPG' str from dual union/**/ all
            select 'ABS_System' str from dual
            select str, replace(regexp_replace(replace(str,'_',' '), '([^[:upper:]])([[:upper:]]{1,})([^[:upper:]]|$)', '\1_\2\3' ),' ') result
            from test_data
    STR     RESULT
    VehicleColor     Vehicle_Color
    WeightClass     Weight_Class
    AverageMPG     Average_MPG
    HighMPG     High_MPG
    LowMPG     Low_MPG
    ABS_System     ABS_System

  • Need regular expression for oracle date format 'DD-MON-YYYY'

    Hi,
    Can anybody tell me the regular expression to validate date in 'DD-MON-YYYY'.
    My concept is i have a table with just two columns item_name and item_date
    Both fields are varchar2 and i want to fetch those records from this table which have valid date format('DD-MON-YYYY').

    If it must be a regexp, this is a starter for you, note it carries the caveats mentioned by both posters above and in the linked thread
    mkr02@ORA11GMK> with data as (select '10-jan-2012' dt from dual
      2  union all select '10-111-2012' from dual
      3  union all select 'mm-jan-2012' from dual
      4  union all select '10-jan-12' from dual)
      5  select
      6  dt,
      7  case when regexp_like(dt,'[[:digit:]]{2}-[[:alpha:]]{3}-[[:digit:]]{4}','i') then 1 else 0 end chk
      8  from data
      9  /
    DT                 CHK
    10-jan-2012          1
    10-111-2012          0
    mm-jan-2012          0
    10-jan-12            0It will not validate content, only string format.
    And to emphasis the points made in the linked thread - dates in text columns is poor design. Always.

  • Regular Expression for website Url the format of

    Hi All,
    I am new to Regular Expression in java.
    I want to validate the web site url.That format is should be like
    "www.sun.com".
    Please help me.
    Thanks.
    Saravanan.P

    Hi Sandeep,
    you can use the below code for website validation.
    <af:inputText label="" id="time" simple="true" value="" contentStyle="width:100px;" maximumLength="100">
          <af:validateRegExp pattern="^www[.][a-z]{1,15}[.](com|org)$"
                         messageDetailNoMatch="Website must be like www.google.com"
                                                                                                   hint="Website Format: www.google.com"/>
        </af:inputText>
    as per your requirement you can change the pattern.
    Thanks
    Prabhat

  • Regular expression for email address formats

    I have the following regulare expression which I am using to validate email address format.
    This allows addresses of the form
    [email protected]
    ^[-a-zA-Z0-9._]+\@[-a-zA-Z0-9]+\.[-a-zA-Z0-9]+\.[-a-zA-Z0-9]+$
    And of course this allows addresses of the form
    [email protected]
    ^[-a-zA-Z0-9._]+\@[-a-zA-Z0-9]+\.[-a-zA-Z0-9]+$
    What I'm looking for is something which will allow both.

    This way
    '^[-a-zA-Z0-9._]+\@[-a-zA-Z0-9.]+$' would allow both. :-)
    with test_data as
    ( select '[email protected]' as val from dual union all
      select '[email protected]'   as val from dual union all
      select 'no#good'              as val from dual
    select
      val ,
      case
        when regexp_like( val, '^[-a-zA-Z0-9._]+\@[-a-zA-Z0-9.]+$' ) then 'Y'
        else 'N'
        end
        as good
    from test_data ;
    VAL                  G
    [email protected] Y
    [email protected]   Y
    no#good              NBut then again, it would also allow "[email protected]" and "[email protected]" too. So I suspect you don't really want something that simply allows your two cases to pass validation. If you want to allow only those two cases then try something like this.
    with test_data as
    ( select '[email protected]'     as val from dual union all
      select '[email protected]'       as val from dual union all
      select '[email protected]' as val from dual union all
      select '[email protected]'      as val from dual union all
      select 'no#good'                  as val from dual
    select
      val ,
      case
        when
          regexp_like
          ( val
          , '^[-a-zA-Z0-9._]+\@[-a-zA-Z0-9]+\.[-a-zA-Z0-9]+(\.[-a-zA-Z0-9]+)?$'
          ) then 'Y'
        else 'N'
        end
        as good
    from test_data ;
    VAL                      G
    [email protected]     Y
    [email protected]       Y
    [email protected] N
    [email protected]      N
    no#good                  N--
    Joe Fuda
    SQL Snippets
    Message was edited by SnippetyJoe - added clarification.

  • Add regular expression to spotlite!

    hello!
    i don't really know where to put this request, so i just do it here:
    please add regular expression search to spotlite!
    would be really great and i think not that much of a work..

    And even more effective would be to do a bit of digging before making suggestions to Apple.
    For instance, a simple googling of "spotlight regex" immediately provides a suggestion or two. Checking Spotlight's query syntax might also lead in interesting directions. And, of course, Spotlight (which is a mighty <censored> excuse for a search engine anyway) is really mdfind, and we all know we can pipe mdfind results to grep, don't we?

  • Regular expression and output format

    hi all,
    i have following scenario-
    regular expression: [0-9]{3}-[0-9]{3}-[0-9]{4}
    generated value by the above regular expression: 123-234-6789
    output format to display the generated above value: xxx-xxx-$1
    now i need to display the generated value (123-234-6789) in the specified output format (xxx-xxx-$1) and the final output will be xxx-xxx-6789
    how is it possible?
    Note: here regular expression and output format can vary
    br,
    bashar

    Hi, Bashar
    You can solve this problem by using the Data Masking Technique.
    Masking data means replacing certain fields with a Mask character (such as an X). This effectively disguises the data content while preserving the same formatting on front end screens and reports. For example, a column of credit card numbers might look like:
    4346 6454 0020 5379
    4493 9238 7315 5787
    4297 8296 7496 8724
    and after the masking operation the information would appear as:
    4346 XXXX XXXX 5379
    4493 XXXX XXXX 5787
    4297 XXXX XXXX 8724
    The masking characters effectively remove much of the sensitive content from the record while still preserving the look and feel. Take care to ensure that enough of the data is masked to preserve security.
    It would not be hard to regenerate the original credit card number from a masking operation such as: 4297 8296 7496 87XX since the numbers are generated with a specific and well known checksum algorithm.
    Best Regards,
    Mahfuz Khan

Maybe you are looking for

  • I'm getting the kernal panic screen when I put in DVD

    My iMac G5, 2 GB has been slow, and occasionally getting the "restart your computer" screen. I ran the Apple Hardware Test on it twice. It passed both times, so I decided it must be software. I proceeded to do a clean install of the OS. Now I'm getti

  • Adobe Photoshop - "Could not save "filename.psd" because write access was not granted."

    Good Afternoon, We have been working through this issue for the past year pretty much and over that time we've migrated to a new Mac OS X 10.9.5 Server and up to CC14 and we are still experiencing this error randomly with our Photoshop users. We have

  • A stopListener in AS3

    I have AS2 code that listens for the end of an instance of FLVPlayback and a .js file that picks that event up and removes the transparent video from the layer above existing HTML content. (I think.) I've been using the combination for two years succ

  • Questions about expected Java expertise

    Hi, For last 8 years I have been doing multimedia and web programming using Microsoft technologies. I have seen a job which is asking for a minimum of 6 months of experience in developing applications using Java 2 platform. They expect to have experi

  • Portable collection fails

    I am trying to do a portable collection on a disconnected workstation. It is a fairly vanilla configuration with not much configuration done. I created the portable collector using the wizard in the ZAM manager, copied the folder contents to a remova