Using SQL Anywhere 16 regex (Perl 5 equivalent) I would like to match all non-digit characters in the following string:
This 100 is 2 a 333 test.
such that the match results in This is a test.
I have a feeling this requires lookarounds but I'm not sure of the exact syntax.
Some of my failed attempts:
\D*
matches This
\D*(?=\d)
matches This
(\D*(?=\d*)|(?<=\d)\D*)*
matches This
I take it that the typical 'search-and-replace' functionality cannot be used in this case, based on added clarifications (and my own search). It also appears that the typical "global" matching is not available. Given that, some remaining options are
Here is an example from SQL Anywhere 12 docs, pulling words out of a string with numbers
The problem is that you'd have to manually provide enough of these to cover the whole string.
REGEXP_SUBSTR
allows a specification of the occurrence to match (first, fourth, ...).One could then write a loop to match simple
\D+
, with increasing position through the loop.However, loops are generally not easily recommended.