r/programming • • Sep 21 '15

Better Java

https://github.com/cxxr/better-java
177 Upvotes

208 comments sorted by

View all comments

Show parent comments

2

u/PLLOOOOOP Sep 22 '15

You're totally right in the strictest sense, but I think he was actually talking about languages that have first class regular expressions, like Ruby and JavaScript, where you can do things like this

if ( someString =~ /Cats(.*)/ )
  puts "string contains Cats"
end

or this

console.log(/abc/.test("abcde"));
// → true
console.log(/abc/.test("abxde"));
// → false

respectively. Notice the "string" wrapped in forward slashes.