Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

regex

Name: Anonymous 2008-03-06 7:43

Looking for some regex (using the RegEx in Java 1.6) help, if anyone can provide.

Is there a way to tell regex to get characters until it sees five consecutive spaces?

Example:
"Tag: Some Words     Tag2: More Words"

I just want to get "Tag: Some Words", and the best I've come up with thus far was regex "Tag:[a-zA-Z\s]{1,}\s{5}". I want to tell it to get single spaces, but I want it to quite when it at least has seen two consecutive spaces in a row...

thanks in advance.

Name: NO EXCEPTIONS 2008-03-06 7:45

>>1
This site is not for asking questions and it is not for Java. Its intended for being nice and coming together to post ``LISP'' and ``LOL SEPPLES FORCED INDENTATION OF CODE LOLOLOL SUSSMAN CUDDER LOL'' and talk about SICP with other members. It was a nice place before you stupid people came and started being rude and asking annoying questions.

Name: Anonymous 2008-03-06 8:06

@phrases = /(.*?)(?:\s{5,}|$)/g;

Name: Anonymous 2008-03-06 8:20

>>3
Why do you hate /prog/?

Name: Anonymous 2008-03-06 8:55

>>1
but I want it to quite when
quite

Name: Anonymous 2008-03-06 8:56

Now you have three problems.

Name: Anonymous 2008-03-06 9:04

>>3

Thank you very much. Only recently started figuring out regex, and that helped a lot.

Name: Anonymous 2008-03-06 9:19

/^((?:\S|\s\S)+)/

Name: Anonymous 2009-03-06 15:30

Want to set your permissions to 777.

Name: Anonymous 2010-12-21 13:33

Name: Anonymous 2013-01-19 14:40

/prog/ will be spammed continuously until further notice. we apologize for any inconvenience this may cause.

Don't change these.
Name: Email:
Entire Thread Thread List