Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Trouble to write regular expression

arun_jadhav2
Explorer
0 Likes
664

I need to find string literals enclosed between single quotes(e.g. 'Sap') from a line.

I used '''.+''' as regular expression pattern

It gives correct result is there is only one string literal present in the sentence. But if there are two or more strings present then it gives only one search result starting from first single quote to last single quote.

E.g.

Case 1:

Sentence: Sap 'community' network

Search result : 'community'

Case 2:

Sentence: 'Sap' community 'network'

Search result: 'Sap' community 'network'

How should be the regular expression so that it gives 'Sap' and 'network' as two serch results in case of case 2?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
630

Hi,

Did you already have a look to program DEMO_REGEX_TOY?

Kr,

m.

3 REPLIES 3
Read only

Sandra_Rossi
Active Contributor
0 Likes
630

Hi,

use FIND ALL OCCURRENCES OF REGEX '''\[^''\]+''' IN ... RESULTS ...

Sandra

Read only

Former Member
0 Likes
631

Hi,

Did you already have a look to program DEMO_REGEX_TOY?

Kr,

m.

Read only

Pawan_Kesari
Active Contributor
0 Likes
630
'[^'\r\n]*'