Preview

visual basic

Satisfactory Essays
Open Document
Open Document
8352 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
visual basic
Function SubMatchTest(inpStr) Dim oRe, oMatch, oMatches Set oRe = New RegExp ' Look for an email address (not a perfect RegExp). oRe.Pattern = "(\w+)@(\w+)\.(\w+)" ' Get the Matches collection. Set oMatches = oRe.Execute(inpStr) ' Get the first item in the Matches collection. Set oMatch = oMatches(0) msgbox typename(oMatch) ' Create the results string. ' The Match object is the entire match - someone@example.com. retStr = "Email address is: " & oMatch & vbNewline ' Get the sub-matched parts of the address. ' someone retStr = retStr & "Email alias is: " & oMatch.SubMatches(0) retStr = retStr & vbNewline ' example retStr = retStr & "Organization is: " & oMatch. SubMatches(1) SubMatchTest = retStr
End Function

MsgBox(SubMatchTest("Please send mail to someone@example.com. Thanks!"))
Function SubMatchTest(inpStr) Dim oRe, oMatch, oMatches Set oRe = New RegExp ' Look for an email address (not a perfect RegExp). oRe.Pattern = "(\w+)@(\w+)\.(\w+)" ' Get the Matches collection. Set oMatches = oRe.Execute(inpStr) ' Get the first item in the Matches collection. Set oMatch = oMatches(0) msgbox typename(oMatch) ' Create the results string. ' The Match object is the entire match - someone@example.com. retStr = "Email address is: " & oMatch & vbNewline ' Get the sub-matched parts of the address. ' someone retStr = retStr & "Email alias is: " & oMatch.SubMatches(0) retStr = retStr & vbNewline ' example retStr = retStr & "Organization is: " & oMatch. SubMatches(1) SubMatchTest = retStr
End Function

MsgBox(SubMatchTest("Please send mail to someone@example.com. Thanks!"))Function SubMatchTest(inpStr) Dim oRe, oMatch, oMatches Set oRe = New RegExp ' Look for an email address (not a perfect RegExp). oRe.Pattern = "(\w+)@(\w+)\.(\w+)" ' Get the Matches collection. Set oMatches = oRe.Execute(inpStr) ' Get the first item in the Matches

You May Also Find These Documents Helpful

  • Satisfactory Essays

    In the Alpha column, use a function to pull just the first letter of text from each record in the Student Name column…

    • 432 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    16.You are examining your addresses file, which contains the first and last names of people you know as well as their street address, city, state, zip code, and telephone number. You want to print a list of last names, which is field 1, and telephone numbers, which is field 7. Which of the following commands enables you to print this list?Answer: c. cut -f1,7 addresses…

    • 1020 Words
    • 5 Pages
    Satisfactory Essays
  • Powerful Essays

    Kids

    • 1159 Words
    • 5 Pages

    Hidden Valley Camp Freedom, Maine For questions, please contact Meg & Peter Kassen: staff@hiddenvalleycamp.com or 800-922-6737 Staff Application |Applicant Name | | | | |Nickname | | | | | | |Permanent if Different | | |Mailing Address | |Address | | |City | |City | | |State | |State | | |Zip | |Zip | | |Phone | |Phone | | |Dates at this address | To | | | |Email Address | | | | |Fax | | | | EDUCATION: |GRADUATE: | |UNDERGRADUATE: |…

    • 1159 Words
    • 5 Pages
    Powerful Essays
  • Powerful Essays

    In the space provided below, copy and paste your VBScript Program Code. If it doesn’t fit, use the next page for the continuation of your sourcecode program…

    • 642 Words
    • 3 Pages
    Powerful Essays
  • Good Essays

    Java

    • 5076 Words
    • 21 Pages

    Explanation: B) Programs are classified as software to differentiate them from the mechanisms of the computer (hardware). Storage and the processor are two forms of hardware while input is the information that the program processes.…

    • 5076 Words
    • 21 Pages
    Good Essays
  • Good Essays

    Programming

    • 3038 Words
    • 13 Pages

    2. Each of the flowchart segments in Figure 3-35 is unstructured. Redraw each flowchart segment so that it does the same thing but is structured.…

    • 3038 Words
    • 13 Pages
    Good Essays
  • Good Essays

    Java

    • 490 Words
    • 3 Pages

    Write a Java program to demonstrate using bitmaps and bitwise operators to sort and remove duplicates from a file of random phone numbers. Do not confuse the term bitmap used for compressing data into smaller spaces with the bitmap that has come to mean a graphic image.…

    • 490 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    May 2012 Writing a Letter of Complaint. LO1: Identify the necessary parts of a letter of complaint. LO2: Devise a letter of complaint, using the correct structure and language. TASK: Answer the following questions in your exercise book.…

    • 295 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    | | | | | | | | | | | | | | | | | | | | | | | |Incharge Human Resources | | | | | | | | | | | | | | | | |Please send your applications at | | | | | | | | | | | |Based Location | | | | | |Email Address | | | | | | | | | | | |Islamabad | | | | | |hr@irp.org.pk | | |…

    • 667 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    J by Author’s Name Based on (if needed) by Author’s Name Author’s Name Address Phone number Transition: SLUGLINE ­ SCENE HEADING This is where the action should go.…

    • 69 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    Visual Programming

    • 3044 Words
    • 13 Pages

    MDI (Multiple Document Interface) and SDI (Single Document Interface) are different interface designs meant to handle documents within a single application. MDI allows an application to contain child windows per document, while SDI enforces one document per window.…

    • 3044 Words
    • 13 Pages
    Better Essays
  • Good Essays

    Dotnet

    • 1251 Words
    • 6 Pages

    Sign in Home Samples Languages Extensions Documentation Community Visual Studio Team Foundation Server/ALM .NET Framework Get started for free Developer Tools and Languages Visual Studio 2012 Application Development in Visual Studio Writing Code Code Snippets Visual C# Code Snippets How to: Use Surround-with Code Snippets How to: Restore C# Refactoring Snippets Code Snippet Functions…

    • 1251 Words
    • 6 Pages
    Good Essays
  • Satisfactory Essays

    You are an accountant at MYB GroupAccountants&Investment Advisors. You have been approached by a group of investorsfor your professional advice on investing in Woolworths Ltd.Your client wishes to adopt an investmentstrategy that seeks to maximise both financial return and social good.…

    • 401 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Computer Fundamentals Basic

    • 7569 Words
    • 37 Pages

    just like you store files and folders in a filing cabinet. Think of Windows XP as…

    • 7569 Words
    • 37 Pages
    Good Essays
  • Satisfactory Essays

    CSE 1021 BASIC COMPUTER APPLICATIONS Introduction to BCA & DBMS CSE 1012 - Basic Computer Applications 2  Lecture : 2hrs/ week Lab: 2 hrs/ Week  Assessment     1 written test (15%)…

    • 946 Words
    • 18 Pages
    Satisfactory Essays