Top "Regex" questions

Regular expressions provide a declarative language to match patterns within strings.

Removing empty lines in Notepad++

How can I replace empty lines in Notepad++? I tried a find and replace with the empty lines in the …

regex notepad++
Split Java String by New Line

I'm trying to split text in a JTextArea using a regex to split the String by \n However, this does …

java regex split newline
Regular expression to allow spaces between words

I want a regular expression that prevents symbols and only allows letters and numbers. The regex below works great, but …

regex space alphanumeric
Find and kill a process in one line using bash and regex

I often need to kill a process during programming. The way I do it now is: [~]$ ps aux | grep 'python …

regex bash terminal awk
How to count string occurrence in string?

How can I count the number of times a particular string occurs in another string. For example, this is what …

javascript regex string
Extract a number from a string (JavaScript)

I have a string in JavaScript like #box2 and I just want the 2 from it. I tried: var thestring = $(this).…

javascript regex string numbers numeric
Regular Expression to find a string included between two characters while EXCLUDING the delimiters

I need to extract from a string a set of characters which are included between two delimiters, without returning the …

regex
Regex: match everything but specific pattern

I need a regex able to match everything but a string starting with a specific pattern (specifically index.php and …

regex
How to remove special characters from a string?

I want to remove special characters like: - + ^ . : , from an String using Java.

java regex
Regex for string contains?

What is the regex for simply checking if a string contains a certain word (e.g. 'Test')? I've done some …

regex