Home > Community > Forums > PCB SKILL > rexMatchp using pipe and grouping

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 rexMatchp using pipe and grouping 

Last post Mon, Feb 18 2013 1:25 PM by EvanShultz. 2 replies.
Started by Pawandeep 23 Dec 2012 10:29 PM. Topic has 2 replies and 1321 views
Page 1 of 1 (3 items)
Sort Posts:
  • Sun, Dec 23 2012 10:29 PM

    • Pawandeep
    • Top 75 Contributor
    • Joined on Sat, Oct 15 2011
    • Singapore, 00-SG
    • Posts 106
    • Points 1,690
    rexMatchp using pipe and grouping Reply
    Hi,

    I want to match a string pattern using rexMatchp using only single instance.

    I wish to search for VF or VS in the beginning of the target string which can be anything like “VF100” or “VR100” or “VS100”.

    Please advice what is wrong with the below syntax, as it returns nil:

    Skill > rexMatchp("^V(S|F)" "VF100")

    nil
    • Post Points: 35
  • Wed, Dec 26 2012 4:28 PM

    • djhutchi
    • Top 100 Contributor
    • Joined on Fri, Nov 14 2008
    • Hillsboro, OR
    • Posts 70
    • Points 870
    RE: rexMatchp using pipe and grouping Reply
    I don’t think the rex* functions support ‘|’ as an alternation metacharacter
    • Post Points: 5
  • Mon, Feb 18 2013 1:25 PM

    Re: rexMatchp using pipe and grouping Reply

    Try the pcreMatchp() function as using a pipe is supported in PCRE.

    pcreMatchp("^V(S|F)" "VF100") => t.

    • Post Points: 5
Page 1 of 1 (3 items)
Sort Posts:
Started by Pawandeep at 23 Dec 2012 10:29 PM. Topic has 2 replies.