Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Try this one:</strong></p> <pre><code>Public Function test(ByVal test_strring$) As Boolean Try Dim pattern$ = "(?s)^(\d+\s*,\s*)+$" ' (?s)^(\d+\s*,\s*)+$ ' ' Match the remainder of the regex with the options: dot matches newline (s) «(?s)» ' Assert position at the beginning of the string «^» ' Match the regular expression below and capture its match into backreference number 1 «(\d+\s*,\s*)+» ' Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+» ' Note: You repeated the capturing group itself. The group will capture only the last iteration. Put a capturing group around the repeated group to capture all iterations. «+» ' Match a single digit 0..9 «\d+» ' Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+» ' Match a single character that is a “whitespace character” (spaces, tabs, and line breaks) «\s*» ' Between zero and unlimited times, as many times as possible, giving back as needed (greedy) «*» ' Match the character “,” literally «,» ' Match a single character that is a “whitespace character” (spaces, tabs, and line breaks) «\s*» ' Between zero and unlimited times, as many times as possible, giving back as needed (greedy) «*» ' Assert position at the end of the string (or before the line break at the end of the string, if any) «$» Return Regex.IsMatch(test_strring, pattern, RegexOptions.None) Catch ex As Exception MsgBox(ex.ToString) Return False End Try End Function </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload