Regex searching for '

  • Thread starter Thread starter Björn
  • Start date Start date
B

Björn

Hello

I need some help using regular expresions.
I need an expresion to find a single ' in a string. The problem, in the
string multiple ' are valid
Example:
My'Test''String'''Test

Only the ' between my and test is invalid.
Can anyone help me?

thx

Björn
 
Björn said:
Hello

I need some help using regular expresions.
I need an expresion to find a single ' in a string. The problem, in the
string multiple ' are valid
Example:
My'Test''String'''Test

Only the ' between my and test is invalid.
Can anyone help me?

negative lookahead:

(?!')'(?!')

or match a greedy '* and check the result for length 1
 
Hi Ben

'* doesn´t work for me, it will find '' too.
This (?!')'(?!') doesn´t work it returns no matches.

thx
Björn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Validating time string 2
Need help with regular expression 2
regex guid tester 4
RegEx, Match but not include 4
regex options 1
How to math string containing '+,()' in .net 5
Regexp and & 9
Regex help 8

Back
Top