Regex - why does this work? (problem with wildcard usage)

Regex - why does this work? (problem with wildcard usage)

bsukbsuk Posts: 92Questions: 26Answers: 2
edited March 2020 in General

I'm trying to understand why this is returning a result. Am I missing something with my understanding of regular expression, or is it a DataTables setting/browser issue that I'm not aware of?

I would expect Integ* to return a result, but it seems to be ignoring the final character?

( Reproducable at: https://datatables.net/examples/api/regex.html )

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586
    Answer ✓

    Yep, that's behaving as expected - see here - you've got to trust Wikipedia ;)

    • The asterisk indicates zero or more occurrences of the preceding element. For example, ab*c matches "ac", "abc", "abbc", "abbbc", and so on.

    Colin

This discussion has been closed.