aqString.StrMatches using Regular expressions not working
- 2 years ago
Hi,
Try this:
aqString.StrMatches("Job ID [0-9]+ completed successfully", "Job ID 1234 completed successfully")
('+' added after [0-9])
Does it help?
P.S. https://regex101.com/ may be used to check if regex works as expected.
- 2 years ago
Yes it does. Thank you!
I'm curious as to why the plus sign works even though it's imbedded within the quoted string. Is this just how this function accepts string concatenation?
- 2 years ago
Hi,
Plus sign here is a part of regex syntax. It means 'any digit from [0-9] range repeated one or more time'.
Without it your regex looked for any single digit from [0-9] range and did not match because the source string contained more than one digit in a row.
P.S. Visit regex101.com and enter your and my regex-es - the pane on the right will provide you with good description of what those regex-es are looking for.