Problem with Regular expression

11 posts / 0 new
Last post
luckiluck

I've tested this regex throughly, but quiterss just can't apply it.

(?:^|])[^[一-龠ぁ-ゔァ-ヴー]+

I want to match all the English words outside the brackets. Anyone know why it's not working?

Sheldon
Hi,

Hi,

so far I'm not sure if I get your issue.
As I understand you have an english text with chinese phrases included and you want to match the english text parts only. Right?
Can you provide a concret example? Maybe some text and a part you try to match.

Kind regards,

Sheldon

luckiluck
Quote: Hi, so far I'm not

Quote:
Hi, so far I'm not sure if I get your issue. As I understand you have an english text with chinese phrases included and you want to match the english text parts only. Right? Can you provide a concret example? Maybe some text and a part you try to match. Kind regards, Sheldon

In the previous post has the link contains the test line. I want to match all the English text which is not inside the brackets. 

Sheldon
Sorry, but following the link

Sorry, but following the link doesn't lead to any test line. Just provide it hear please.

Or do you maybe mean this text?

Welcome to RegExr v2.0 by gskinner.com!

Edit the Expression & Text to see matches. Roll over matches or the expression for details. Undo mistakes with {{ctrl}}-z. Save & Share expressions with friends or the Community. A full Reference & Help is available in the Library, or watch the video Tutorial.

Sample text for testing:
abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789 +-.,[email protected]#$%^&*();\/|<>"'
12345 -98.7 3.141 .6180 9,000 +42
555.123.4567 +1-(800)-555-2468
fooatdemo.net bar.baattest.co.uk
www.demo.com http://foo.co.uk/
http://regexr.com/foo.html?q=bar

luckiluck
The link work fine for me,

The link work fine for me, but I'll post here anyway.

[おはようございます] [uk] Good morning おはようございます

I want to match the "Good morning" part only.

Btw, I would like to ask, does quiterss support look-behind (regex)?

Sheldon
Here we are!:-) Please try

Here we are!:-) Please try this without the quotes.

"\b\w+\b " or " \b\w+\b"

luckiluck
Quote: Here we are!:-) Please

Quote:
Here we are!:-) Please try this without the quotes. "\b\w+\b "

Seem like it's still not working, it's still match the English text inside the brackets. sad

http://regexr.com/3c5d2

Sheldon
You might not have used the

You might not have used the [SPACE] at the beginning or at the end. It's really meant like this [SPACE]\b\w+\b

luckiluck
Quote: You might not have

Quote:
You might not have used the [SPACE] at the beginning or at the end. It's really meant like this [SPACE]\b\w+\b

As it shows in the link provided, I've not insert any space like you said. You can use these websites to check the regex and the test line as I had provided: [おはようございます] [uk] Good morning おはようございます. It should match only the "Good morning" part.

http://www.regexr.com/

https://regex101.com/

luckiluck
Quote: \b\w+\b

Quote:
\b\w+\b

This works somehow. Thanks a lot smiley

Sheldon
I tested it there and it

I tested it there and it works fine. Just add a space before the first \b or after the second \b.. 

It works because there is always a space between words.